You are on page 1of 2

Create custom params file in yii framework

Yii framework is come with powerful inbuild features eg. 1. Model-View-Controller (MVC) design pattern 2. atabase !ccess "b#ects ( !") $. Custom %uery &uilder' !cti(e )ecord (!)) and & Migration *. +orm input and (alidation ,. !-!.-enabled widgets /. !uthentication and authori0ation 1. 2ayout 3kinning and theming 4. 5eb ser(ices 6. 7nternationali0ation (7148) and locali0ation (2198) 19. 2ayered caching scheme 11. :rror handling and logging 12. 3ecurity 1$. ;nit and functionality testing 1*. !utomatic code generation (<ii Module) 1,. +riendly with third-party code 1/. etailed documentation 11. :=tension library etc. Most of yii beginner write parameter in main.php because thats pattern comes in installed yii framework. >his is fine if you ha(e less parameter but if you are building large web portal or application then it?s (ery hard to manage e(ery thing in mail.php because its main config file. 3o the best way is create seperate params.php in the same directory and

include it in you main.php file. Check is below e=ample of params.php and main.php files. config/main.php :
?params?@AreBuire(dirname(CC+72:CC).?Dparams.php?)'

config/params.php :
EFphp return array( ?defaultGage3i0e?@A19' ?website8ame?@A?e0eeli(e.com?' ?copyright7nfo?@A?Copyright HcopyI ?.date(JKJ).? :0eeli(e >echnologies. !ll )ights )eser(ed.?' ... )I FA

5ritten &y L :0eeli(e >echnologies

You might also like