Reputation: 6820
I want to know if and how I can define a file to be included.
for e.g.
<?php
//define('_login',inlcude('file.php'));
define('_login',include('file.php')); // edited due to typo..
?>
or would I need to do it this way
<?php
define('_login','file.php');
include(_login);
?>
the reason I ask is My site allows plugins and I want other developers to overwrite a define to include their plugin instead of the core _login define.
Upvotes: 1
Views: 1389
Reputation: 30488
you have to use it like this
<?php
// works
if ((include 'vars.php') == 'OK') {
echo 'OK';
}
?>
http://php.net/manual/en/function.include.php
Upvotes: 0
Reputation: 12815
This one should be Ok:
<?php
define('_login','file.php');
include(_login);
?>
Event can't imagine what will happen in first case. Maybe if you return something from file - that value will be used?
Upvotes: 1