Awhile ago I was trying to find a database driven CMenu system to add to my web applications. This always seemed to me that it would be a lot easier to manage if it where in a database. So the following is the results of that effort:
Awhile ago I was trying to find a database driven CMenu system to add to my web applications. This always seemed to me that it would be a lot easier to manage if it where in a database. So the following is the results of that effort:
Suppose you have Products,Categories and each product belongs in many categories
Knowledge is necessary to determine the address of the controller in a single layer system. This allows you to quickly search and painlessly produce refactoring controllers and their addresses.
In this wiki I will show how to Disallowing login for Inactive users. Only Active users can logging and access their account. You can set privacy for your yii web apps users.
login links will be
This behavior will automatically set timestamp fields to the row creation and modification times.
Note the tag {{homeUrl}}
will be dynamically replaced at runtime.
If you are coming over to Yii 2 from Yii 1.x, you may have already read this useful wiki for creating dependent dropdowns. You can use a similar approach in Yii 2 to do the same. But if you are looking at a prebuilt solution that helps you manage it easier, read along.
For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.
In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...
Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.
In this wiki I will show how to create own custom global function. It may be save the space and reduce the time.
Create param.php file in protected/config
Yii::app()->params['TEXT_ACTIVE'] = 'Active'; //1 for active
Once you are completed with the "Creating First Yii Application", the following can be done.
Example settings when using Gettext for i18n.
Some PHP installations may use a different php.ini
file for CLI PHP (command line PHP parser). As a result, when running the model
or crud
command in yiic shell
, you may encounter errors like "YiiBase::include(PDO.php): failed to open stream..." or "...could not find driver", even though the requirement checker confirms you have PDO and the corresponding database driver.
How to display status image on admin gridview.
1) Add a fancy-box extension on admin page
1) include the fancybox extesion otherwise fancybox js
Yii's ActiveRecord classes are powerful, but they fall short when you want to have a configurable table prefix for your application.