Yii's AR single-row automatic data caching mechanism
CActiveRecord
CActiveRecordBehavior
Cache
Active Record
Active Record (AR) is a popular object-relational ing (ORM) technology. Yii DAO can process almost any database-related tasks. However,
How does Yii ensure the uniqueness of a URL?
For example, we have the following rules:
1
'Post/
'=> 'Post/read ',
The following URLs are valid:
123
Post/read/id/5 post/read? Id = 5 post/5
If we
First, create a new field (integer type) in the user table with the field name 'accesslevel'. it defines the user's access permission database.
First, create a new field (integer type) in the user table, field name'AccessLevel', Which defines the
You are welcome to add the mistakes that are easy to make during Yii development.
You are welcome to add the mistakes that are easy to make during Yii development.Forget echo
In the following view output:
Edit item:
Label;?>
You may spend a
There are many ways to automatically set the yii timestamp in the ActiveRecord model. The following two methods are described:
There are many ways to automatically set the yii timestamp in the ActiveRecord model. The following two methods are
This article describes the implementation of the yii verification code, which is just a small example of the application by the Author. it is also available on the internet. to sum up, I hope to help Yii enthusiasts who need it. 1. I use user logon,
How to load the Yii-bootstrap extension in a specified action
I encountered a major problem when using Yii-Bootstrap extension, because the pre-loading mechanism made all AJAX requests initialize bootstrap. This is a great waste of resources,
Display friendly time formats in yii
I recently encountered this problem when I was writing the yii Chinese encyclopedia program. I used to date ("Y-m-d H: I", $ time. However, many websites now display time as several minutes ago, several hours ago,
In this Wiki, you can learn how to use a database to create a front-end and back-end login forms.
In this Wiki, you can learn how to use a database to create a front-end and back-end login forms.Application scenarios
After creating the default yii
If you need simple role-based access control instead of long RBAC processes, this article is perfect for you. Let's go straight to the topic.
If you need simple role-based access control instead of long RBAC processes, this article is perfect for
Search and sort by association model in the GridView
Search and sort by association model in the GridView
First, we have two models that are directly associated:
class Author extends CActiveRecord { ... } class Post extends CActiveRecord { ...
By viewing the forum, I found this is a common problem, so I decided to write this article.
How to create a simple (non-RBAC) user authorization system
By viewing the forum, I found this is a common problem, so I decided to write this article.
This
In many cases, the validation rules provided by yii do not meet our requirements. all of them need to be defined to comply with our own rules. Custom validation rules
In many cases, the validation rules provided by yii do not comply with our
The scenario is a very useful tool for separating all CModel derived class verification tasks. here we will use CActiveRecord.
The scenario is a very useful tool for separating all CModel derived class verification tasks. here we will use
Set the attribute $ view to 'smarty 'in the controller, and indicate to the controller that I use Smarty as The View layer, instead of using the built-in cake
I tried two methods:One is: http://projects.simpleteq.com/CakePHP/smarty.htmlAnother is:
Recently I encountered a problem where many plug-ins of cakephp come with built-in template files, such as plugin/Users/View/Users/login. ctp, I want to rewrite login. but this plug-in is a git submodule. after modification, submodule cannot be used
First, declare an attribute in the model class to store the file name (either formmodel or activerecordmodel ). Similarly, a file verification rule is declared to ensure the specified extension of the uploaded file.
First, declare an attribute in
Different PHP installation environments may use different php. ini-CLIPHP (command line PHP parser ). Therefore, when running the model or crud command to use yiicshell, even if you confirm that you have enabled PDO and the corresponding database
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service