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?
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.
For example:
We have a record in a database with field switch
having 0 or 1 values.
After that we want a user to see on
or 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.
hai teman yii... apa kabar.. kembali lagi bersama catatan saya..
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:
Checkboxes have two possible values, true
and false
, but some applications require that the user select one particular value before proceeding. Examples might be:
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:
~~~
Error 403
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
This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code:
Delploying anything using joomla's framework is quite difficult. The framework don't provide a good MVC structure and the documentation is very poor.
Create a folder where to place an Yii app under wordpress folder (mine is "yii')