I would like to add a blog to a web site. Couldn't find any good blog extension for Yii, so I decided to just use Wordpress. (Please let me know if there's a better way)
I could just extract wordpress in the root folder and run it.
http://www.example.com/wordpress
However, the Yii framework has its index.php on root folder so I will have to make wordpress either a module or extension (I think) unless I put the Yii framework in a root/yiiFolder and use root/wordpress to separate the two. Also, the main layout will have to be different than the Yii default main layout. Otherwise, the blog will share the same header and footer structure of Yii.
Could someone give me an example on how Yii framework call a non-yiiframework site?
If you are having the following error:
include(Translation_Entry.php): failed to open stream: No such file or directory
then you need to disable Autoload, for example like this:
spl_autoload_unregister(array('YiiBase','autoload'));
$wp=dirname(__FILE__).'/../../../../wp-load.php';
require_once($wp);
spl_autoload_register(array('YiiBase','autoload'));
http://wpengineer.com/1038/embed-wordpress-functions-outside-wordpress/ - here is described how to call wordpress functions from outside wordpress. I tried the same thing from Yii layout and now I'm facing strange error. include(Translation_Entry.php): failed to open stream: No such file or directory
. I need to look a little more into this.
Other than that - this solution (if you manage to configure it) should give you what you want.
You can include wordpress as a library, and require_once 'wp_config.php'
in index.php. Then you can call wordpress function directly.