Ok. I have my Yii app running "inside" of WordPress, as described here: http://www.yiiframework.com/wiki/213/integrating-wordpress-and-yii-yet-another-approach/
It’s a bit of a hack, but it works for my needs.
Now, my issue is that I want to have some items added to the WordPress menu depending on if the user is logged in or not. BUT, I want these items to be there even on WordPress pages, not just on the Yii application pages.
For example, the app I have lives at /yiiapp/ WordPress is installed at document root (/).
Obviously only within yiiapp/ are the pages going to have access to Yii. Adding items to the menu from there is trivial. The issue is when the user switches to, say, the home page, which is just the WordPress index page. Now, I have no way to add those Yii menu items.
Inside the WP theme that generates the menu I tried doing something like this:
$yii=dirname(__FILE__).'/../../../../yii-1.1.10.r3566/framework/yii.php';
$config=dirname(__FILE__).'/../../../yiiapp/protected/config/main.php';
require_once($yii);
Yii::createWebApplication($config);
$yiiMenu = new WpMenu;
$yiiMenuItems = $yiiMenu->getMenu();
WpMenu is my class to generate the additions to the menu. It works, EXCEPT that this is being called by the server, not by the user - so I don’t have the user’s session information, so I have no way to know if the user is logged in, thus I have no way to know what menu items to show them!
Any ideas on how else I could get this working?