ChromePHP is a console logging extension for Google Chrome.
In this guide I will explain best practise regarding performance in MySQL, PHP and of course our loved Yii Framework. Since this is a complex topic, I will start with some basics and then expand this guide from time to time. Since this wiki can become big, you may click on
View history - there you can see what changes have been made, so you don't miss anything.
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
We have a record in a database with field
switch having 0 or 1 values.
After that we want a user to see
off instead 1 or 0.
So we do the usual thing:
<?php $this->widget('zii.widgets.grid.CGridView', array( //..... array( 'name'=>'...
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.
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...
Todos los que hemos empezado a utilizar Yii para crear aplicaciones Web, nos hemos dado de bruces cuando hemos intentado poner a funcionar el RBAC (acceso de control basado en roles).
PHPIDS é conhecido projeto que pode ser visto em php-ids.org.
My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:
PHPIDS is a well known project that can be found in php-ids.org.
After enabling the Gii module in your
protected/config/main.php file and then try to use it with
http://example.com/index.php?r=gii, you get an error:
You are not allowed to access this page.
This is almost certainly caused by the IP filtering mechanism that Gii uses to protect your system from outsiders - by default it allows
localhost only (both IPv4 and IPv6), and r...
Since PHP is dynamically typed language, the way IDE may help you is limited.
You have to extend the widget class and configure it for user login widget