Yii config configuration

Source: Internet
Author: User

YII2 configuration file Common Configuration summary
<?phpMaster configuration file$config =Array' Modules ' =Array' GII ' =Array' Class ' =' System.gii.GiiModule ',' Password ' =' admin ',),' BasePath ' = dirname (__FILE__). Directory_separator.‘..‘,' Name ' + =' Yii learning ',Project name' Preload ' =Array' Log '),' Import ' =ArrayAuto Load Class' Application.models.* ',' application.components.* ',),' Defaultcontroller ' =' Index ',Default Controller' Layout ' =' Layout ',Layout file' Components ' =Array' db ' = =ArrayDatabase configuration' ConnectionString ' =' Mysql:host=localhost;dbname=h.me ',' Username ' =' Root ',' Password ' =‘‘,' CharSet ' =' UTF8 ',' Tableprefix ' =' Tp_ ',' Enableparamlogging ' =TrueShow SQL with parameters),' Urlmanager ' =Array' Urlformat ' =' Path ',PathInfo mode' Showscriptname ' =FalseSetting false when hiding index.php' Urlsuffix ' + '. html ',//url suffix equivalent to pseudo-static),' ErrorHandler ' =Array' ErrorAction ' =' Index/error ',404 error jumps to the method),' Log ' =Array//log  ' class ' =  ' Clogrouter ', Span class= "hljs-string" > ' routes ' + array (array ( ' class ' =  ' Cweblogroute ',  ' levels ' = >  ' trace,error,waring ', //application Log display level  categories ' =  ' system.* ', //record category),),), Span class= "hljs-string" > "params" = require (dirname (__ FILE__). return  $config; ?>             


==================== advanced version of Configuration ============================
<?phpreturn [' Defaultroute '=' Home/index ',' Components '= [' DB '= [' Class '=' Yii\db\connection ',' DSN '=' Mysql:host=localhost;dbname=dbname ',//' DSN '=' Mysql:host=localhost;dbname=webshop ',' Username '=' Username ',' Password '=' Password ',' CharSet '=' UTF8 ',' Tableprefix '=' Table_ '],' Mailer '= [' Class '=' Yii\swiftmailer\mailer ',' ViewPath '=' @common/mail ',Send all mails to a fileByDefault. You have the To set//' Usefiletransport ' toFalseand configure a transport//For the mailer to send real emails.' Usefiletransport '=True,],' Captcha '=>[' Class '=' Yii\captcha\captchaaction ',' MinLength '=4,' MaxLength '=4],//' View '= [//' Renderers '= = [// ' html ' = + [// ' class ' = ' Yii\smarty\viewrenderer ',// ' options ' ' = = [// ' left_delimiter ' + ' = ' {',// ' right_delimiter ' = ' + '} ' // ] // ],// ],//// ] ],]; 


0

Yii config configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.