-
-
Save ReactiveRaven/2775139 to your computer and use it in GitHub Desktop.
scope issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*************** | |
* | |
* My Wordpress plugin | |
* | |
*********************/ | |
$myvar = "Hello"; | |
function show_my_var(){ | |
global $myvar; | |
echo "myvar = ".$myvar; | |
} | |
show_my_var(); | |
/*************** | |
* | |
* My Symfony controller | |
* | |
*********************/ | |
class MyController { | |
public function myAction(){ | |
include 'my-wordpress-plugin.php'; | |
} | |
} | |
$c = new MyController(); | |
$c->myAction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment