Skip to main content

Create custom params file in yii framework



Yii framework is come with powerful inbuild features eg. 
1. Model-View-Controller (MVC) design pattern 
2. Database Access Objects (DAO) 
3. Custom Query Builder, Active Record (AR) and DB Migration
4. Form input and validation 
5. AJAX-enabled widgets 
6. Authentication and authorization 
7. Layout Skinning and theming 
8. Web services 
9. Internationalization (I18N) and localization (L10N) 
10. Layered caching scheme 
11. Error handling and logging 
12. Security 
13. Unit and functionality testing 
14. Automatic code generation (Gii Module) 
15. Friendly with third-party code
16. Detailed documentation 
17. Extension library etc.

Most of yii beginner write parameter in main.php because thats pattern comes in installed yii framework. This is fine if you have less parameter but if you are building large web portal or application then it's very hard to manage every thing in mail.php because its main config file. So the best way is create seperate params.php in the same directory and include it in you main.php file. Check is below example of params.php and main.php files.
config/main.php :
'params'=>require(dirname(__FILE__).'/params.php'),
config/params.php :
<?php
return array(
 'defaultPageSize'=>10,
 'websiteName'=>'ezeelive.com',
 'copyrightInfo'=>'Copyright &copy; '.date("Y").' Ezeelive Technologies. All Rights Reserved.',
 ...
 ...
);
?>

Comments

  1. As a web development and design service provider Webzin Infotech provides optimum solutions to customer by helping them to achive there goals and make available there services and products in the online market.

    ReplyDelete
  2. Every web design companies and development firms should give the proper responsive to their clients have capability to fulfill the requirement of customers.Then only they would get a chance to improve their business.
    Web Design Company | Website Design Companies

    ReplyDelete
  3. Thanks for sharing such a wonderful post.We also provides the best Web Design & Development services in India.

    ReplyDelete

Post a Comment

Popular posts from this blog

Comparison between Prestashop and CS Cart eCommerce System

We (Ezeelive Technologies) are comparison CS Cart with another famouns eCommerce system called Prestashop. Both Prestashop and CS Cart use their own in-build Php MVC pattern. Our development team have find  Prestashop  has such good features like Frontend and Backend Speed, Product Comparison, URL Rewriting, HTML5 Image Uploader, Taxes, Stores Locator etc. Read more :  http://www.ezeelive.com/blog/comparison-prestashop-cs-cart-ecommerce-system/

Advantages of Php Web Development

Now a day PHP has turn out to be the most demanding web programming language for web development. There are several reasons why PHP Development is in great demand these days. If you would like to hire PHP developers to develop your business or not, it's a fine thought to be aware of these advantages associated with the development of PHP to understand your best options. PHP has become one of the most useful web programming platforms, as well as Linux and MySQL . The only costs associated with working with these technologies are the cost of hiring PHP Web developers . Benefits of development in PHP language: 1. It is an open source language therefore it's free. 2.  PHP development provides the best performance at an affordable price which is a great dynamic pages. 3. Coding is very easy to learn 4. PHP language syntax is similar to those of C and C++ languages. 5. Any changes to the site during or after the development can be done easily. 6. The framework and the