Yii-YiiPHP framework 1.1.11 released

Source: Internet
Author: User
We are very pleased to announce the release of Yii Framework 1.1.11. In this version, we have included more than 100 improvements and bug fixes.

We are very pleased to announce the release of Yii Framework 1.1.11. In this version, we have included more than 100 improvements and bug fixes.

This version is of special significance, because it is the first version we have migrated to github, and a lot of work is contributed by our community, including new features, bug fixes, unit tests, and translations.

We are very grateful to those who have paid their brains and time for Yii: resurtm, DaSourcerer, cebe, suralb and others.

For the complete modification list, see change log and add important functions. If you plan to upgrade from the old version to 1.1.11, please read the upgrade instructions.

Next we will briefly introduce some modifications in the new version.

HTML5 fields supported in CHtml

We added a set of methods for CHtml:

  • CHtml: dateField ()
  • CHtml: rangeField ()
  • CHtml: numberField ()
  • CHtml: emailField ()
  • CHtml: urlField ()
  • CHtml: activeDateField ()
  • CHtml: activeRangeField ()
  • CHtml: activeNumberField ()
  • CHtml: activeEmailField ()
  • CHtml: activeUrlField ()

They are used as follows:

echo CHtml::activeNumberField($model, 'fieldName');
CFormatter: formatSize ()

This is a new method that allows formatting of bytes.

Echo Yii: app ()-> format-> formatSize (115969); // Display: 113.25 KB
Console Application return code

You can now return an integer in the console action and use it like an application return code.

Learn more see http://www.yiiframework.com/doc/guide/1.1/en/topics.console#exit-codes

CJavaScript: encode () and js:

When your program's CJavaScript: encode () uses user input as a parameter, your program is insecure. to avoid this, you can set the second parameter to true.

CJavaScript::encode($userInput, true);

This will disable the parameter prefix js:, if you need to use a JavaScript expression. You can use csf-criptexpression around.

CJavaScript::encode(new CJavaScriptExpression('alert("Yii!");'), true);

Note: The second parameter does not work for CJavaScriptExpression.

HTTP cache

The new version introduces CHttpCacheFilter for a simple cache output in an action. this filter sets an HTTP header to notify the client that the page content has not changed after the last request, in this way, the server will not re-transmit the content. The setting of CHttpCacheFilter is similar to that of COutputCache.

public function filters() { return array( array( 'CHttpCacheFilter + index', 'lastModified'=>Yii::app()->db->createCommand("SELECT MAX(`update_time`) FROM {{post}}")->queryScalar(), ), ); }

For more information, see The Authoritative Guide.

Model Validation rule blacklist

If you want to avoid verification in special scenarios, you only need to set parameters that contain the scenario name. The syntax is as follows:

// Use commas to separate multiple scenarios (ignore spaces) array ('username', 'required', 'ignort' => 'Ignore, this, scenarios, at-all ',)

For more information, see The Authoritative Guide.

New tools and workflows of the translation team

The new translation rules are defined for the translation workflows hosted on github. The new tools can display all the changes after the last update. We hope this will help the translation team

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.