Is there any technique to use Yii within WordPress?

I am familiar with WordPress environment and wp developement.
Now I want to extend my knowledge with YII framework of PHP and I am learning things over YII.

I want to know if any technique or trick exist to use YII within WordPress for theme and plugin development.

Read More

Looking for your answers 🙂

Related posts

Leave a Reply

3 comments

  1. Yes, it’s quite doable. Read my article about it here: http://www.yiiframework.com/wiki/322/integrating-wordpress-and-yii-still-another-approach-using-yii-as-the-router-controller/

    Note: it isn’t that straightforward, so if you are new to Yii it may get complicated fast. But feel free to ask on the forums and we’ll see if we can get you going.

    I’m also going to put up a base Yii/Wordpress setup on Github at some point. If you subscribe to that article, you should get a notice when I do.

    Edit: GitHub repo here: https://github.com/acorncom/yii-wordpress-integration

  2. Not easily. WordPress is not written using the Yii framework, and most of the tasks that Yii would implement (database abstraction, request routing, caching, etc.) are already handled by WordPress in totally incompatible ways.

    As others have noted, it’s possible to integrate the two, but it’s an awkward fit. You may want to consider first whether it would make more sense to use either Yii or WordPress alone.

  3. Yes. You can read Using Yii in 3rd-Party Systems section from the Definite guide to Yii for more information:

    Yii can also be used as a self-contained library to support developing and enhancing existing 3rd-party systems, such as WordPress, Joomla, etc. To do so, include the following code in the bootstrap code of the 3rd-party system:

    require_once('path/to/yii.php');
    Yii::createWebApplication('path/to/config.php');
    

    The above code is very similar to the bootstrap code used by a typical Yii application except one thing: it does not call the run() method after creating the Web application instance.