Free Articles, Free Web Content, Reprint Articles
Saturday, March 23, 2019
Free Articles, Free Web Content, Reprint ArticlesRegisterAll CategoriesTop AuthorsSubmit Article (Article Submission)ContactSubscribe Free Articles, Free Web Content, Reprint Articles

Future Enhancements in Blogging using YII Framework

As we all know that writing is one of the pillars of rich content. Now days it is less important than it was few years ago. Where is this heading? There are some trends which will have a huge impact in the future of blogging. These trends are applying pressure to your ability to succeed with long-form content on the web.


For the future enhancements using Yii you need to internationalize your blog application so that its pages can be viewed in different languages. There are two aspects of enhancement in blogging.

First, we can create the view files in different languages. For example, for the index page of PostController, we can create a view file like /wwwroot/blog/protected/views/post/zh_cn/index.php. This application has been configured to use simplified Chinese (language code is zh_cn); using yii will automatically use this new view file instead of the original one.

Second, we need to create message translations for those messages generated by code. These message translations should be saved as file under the directory /wwwroot/blog/protected/messages. If we are using text strings then we need to modify the code by enclosing them in the method call yii::t ().

How to use a Theme

Our blog is already themeable by default, even if we don’t write any code. In order to use the theme we need to develop the theme by writing customized view files in the theme. For example, if we want to use a theme named classic that uses a different page layout, we need to create a layout view file./wwwroot/blog/themes/classics/views/layouts/main.php. We also may change the application configuration to indicate our choice of classic theme:

Return array (


`theme’=>’ classic’,



Improvement in caching feature

Though yii framework is very efficient but it is not necessarily true that any application which is written in Yii framework is efficient. There are several enhancement rooms in our blog application to improve the performance. For example, the tag cloud portlet could be one of the performance bottlenecks due to its complex database query and php logic.

We can improve performance by creating sophisticated caching feature by Yii framework. One of the very common and useful components in Yii is COutputCache, which caches the fragments of display so that the code behind the application generating the fragment does not need to be executed for every request. For example, in the layout file/ wwwroot/blog/protected/views/layouts/column2.php, we can enclose the tag cloud portlet with COutputCache:

beginCache('tagCloud', array('duration'=>3600))) { ?>     widget('TagCloud', array(        'maxTags'=>Yii::app()->params['tagCloudCount'],    )); ?> endCache(); } ?>

This is the code which is used to create the display from cache instead of being generated on every request. The content in the cache will be valid for 3600 seconds.

Addition of New Features

Our blog is not that efficient that its applications are having very advance functionalities but it is sure that it has got the basic functionalities. There is a need of lot of effort to become a complete blog system. Still more features needed every time, for example, email notifications, post categorization, archived post portlet , calendar portlet, and so on. The final deployment and the tune-up of the framework come with the following enhancements. For example, changing Home Page, Enabling Schema Caching, Disabling Debugging Mode and Deploying the Application. Readers of this article are not required to have a prior knowledge about Yii butBusiness Management Articles, basic knowledge of object oriented programming and database programming would help the readers to understand the article.


Source: Free Articles from


Sheraz saleem ghouri is an upcoming article writer. He is an engineer and a business graduate. Presently, he is a senior O level teacher and a student counselor at a very renowned institution. He is interested in education, Technology, events and blog management writings.

You may contact him on the below address.

Home Repair
Home Business
Self Help

Page loaded in 0.052 seconds