發表文章

目前顯示的是有「yii」標籤的文章

Yii: gii - Error 403 You are not allowed to access this page.

In Yii, if you have error 403 in gii " Error 403 You are not allowed to access this page." You can set the following code for IP Filters in protected/config/main.php ipFilters '=>array($_SERVER[' REMOTE_ADDR ']),

[Yii] User-friendly URLs

Creating URLs User-friendly URLs Using Named Parameters Parameterizing Routes Parameterizing Hostnames Hiding  index.php Faking URL Suffix Using Custom URL Rule Classes Complete URL management for a Web application involves two aspects: When a user request comes in terms of a URL, the application needs to parse it into understandable parameters. The application needs to provide a way of creating URLs so that the created URLs can be understood by the application. For a Yii application, these are accomplished with the help of  CUrlManager . Note:  You can specify URLs without using Yii but it is not recommended since you will not be able to easily change URLs via configuration without touching application code or to achieve application portability. 1. Creating URLs  Although URLs can be hardcoded in controller views, it is often more flexible to create them dynamically: $url = $this -> createUrl ( $route , $params ) ; where  $...