The static cache here refers to the HTML cache. The HTML cache generally does not need to judge whether the data is to be updated, because the HTML cache usually does not change the content frequently. When the data is updated, you can force the
Finally, let's take a look at object creation. in the YII Framework, there are two methods to create objects: 1. use the new keyword; 2. use the Yii: createComponent method.
When creating a php object, you must first include the definition file of
CActiveRecord is widely used in Yii applications. the design focuses on optimization rather than complex SQL statements. In fact, most of them are designed to use friendly SQL modes to solve practical problems.
CActiveRecord is widely used in Yii
The first thing to do is to initialize a Model with a scenario. we have two methods to implement it.
The first thing to do is to initialize a Model with a scenario. we have two methods to implement it.1. the new CActiveRecord uses the constructor's
Easy management of Yii constants to obtain constants
I used a method to solve this problem.GetConstants ().?
1234567891011121314
PublicstaticfunctiongetConstants ($ token, $ objectClass) {$ tokenLen = strlen ($ token); $ reflection =
We need to use the htmlpurifier class in an action, which can enhance any model and indicate the attributes we want to make them XSS secure.
We need to use the htmlpurifier class in an action, which can enhance any model and indicate the attributes
Through firebug, we found that every time we click the sort button generated by CSort, two sort classes (descasc) will be attached to the URL of links ), so we can use these two classes for sorting to achieve AJAX refresh and add arrows with
Yii generation of thumbnail generation function cthumb requirements
Yii 1.0 and later versions
GD library required
Download Site attachmentInstall
Decompress the file to protected/extensions.
Extension = php_gd2.dll
Use
See the following
What is the database structure of the CMenu menu controlled by the database?
1234567891011121314151617181920212223242526272829
Create table if not exists 'menu '('menu _ id' int (11) not null auto_increment, 'name' varchar (255) not null,
Yii how to use PHPMailer to send emails
As a common component:
In this example, use SMTP as the sending method to create a component in the controller:
12345678910111213
Host =
; $ Mailer-> IsSMTP (); $ mailer-> From =
Okay, data processing is complete. now we only need to call the relevant data in views/main. php. The keyword is used as an example.
1. create a table structure ?
123456
Create table if not exists 'config' ('name' varchar (128) not null,
Yii searches and sorts data using correlated models in the GridView. First, we have two models that are directly associated with each other.
?
123456789101112131415
ClassAuthorextendsCActiveRecord {...} classPostextendsCActiveRecord {...
Use yii to develop RESTAPI
Recently, I have a project for Android client development. because I need to communicate with the server, I decided to use RESTFUL APIs after reading some documents.
Here I will share with the blog program that comes with
During Yii development, we often encounter a problem. every time we use Yii components and extensions, we will write them as follows:
During Yii development, we often encounter a problem. every time we use Yii components and extensions, we will
In the previous chapter, we learned how to assign variables to template variables through the assign method. This article details how to use tags to output Template variables in templates. In the previous chapter, we learned how to assign variables
Starting from this article, we will explain in detail the usage of built-in functions in the framework. D method D should be a lot of methods used to instantiate a custom Model class. it is an encapsulation of Model class instantiation by the
Webshell, such as eval ($ _ POST []), is familiar to everyone. in recent years, many variants have been derived based on common webshells, increasing the difficulty of detection. let's take a look at several samples extracted from the internet first
The PHP collection of a single file saves the collected id data to a txt file, and runs the php file to automatically run the collection, mainly to understand a collection principle of PHP, it is not suitable for direct website application. this
A php function dedicated to file search can be encapsulated as a php file search class. This php function is a bit similar to the search file ctrl + f in windows. you only need to make some modifications, the front-end submission page is also
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