Since PHP is dynamically typed language, the way IDE may help you is limited.
Since PHP is dynamically typed language, the way IDE may help you is limited.
How to create a simple (non-RBAC) authorization system
In a Web application, we often need to display pages like "about this site", "legal information", whose content are mostly static. There are several approaches to deal with this kind of pages.
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'=>'...
I recently created a project called Yii-App on GitHub to kickstart my development of smaller Yii applications. The main goal of the project is to provide a ready-to-use application template that includes my bootstrap extension and many other useful extensions. After reading this article you will be able to use...
Yiinitializr\Helpers\Initializer::create('./../', 'frontend', array(
// will override frontend configuration file
__DIR__ .'/../../common/config/main.php', // merged with
__DIR__ .'/../../common/config/env.php', // merged with
__DIR__ .'/../../common/config/local.php' // merged with
))->run();
`
This namespace brings utilities to interact with...
Sometimes you need to force a user to change their password after x number of days. This article describes how to implement this using a filter, ChangePasswordFilter.
This is a tutorial for how to add input text-Field, check-box, buttons in CGridView.
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
There are two ways to run a cron job:
Validators extending from [CValidator] all have a property named [message|CValidator::message]. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one:
This wiki has been replaced by Use crypt() for password storage.
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.
If you want to add module based login to a site without using RBAC, please follow these guidelines.
Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...
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.
This tutorial shows how to filter CListView items by AJAX, and it's compatible with disabled JavaScript users
In my case this has been done to filter users list
To get null
from database instead of empty strings you need to set up your DB connection as follows:
It's common to see users wishing to make substring DB queries, using the %
metacharacter used to match anything; in this FAQ we'll search the tbl_comments
table from the blog tutorial hoping to find the text in $match
in the content
column
Many time for SEO porpouses is important that each page will have a unique address.