From 881a85d463a4593d510aa2f907b01ce4ac167e31 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 6 May 2013 20:24:22 -0300 Subject: [PATCH 1/3] Fixed doc about renderers. --- docs/guide/upgrade-from-v1.md | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index 1aab3d1..5da5254 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -136,23 +136,9 @@ with significant improvements. For more details, please see the "assets" subsect While Yii 2.0 continues to use PHP as its main template language, it comes with built-in support for two popular template engines: Smarty and Twig. The Prado template engine is -no longer supported. To use these template engines, simply configure the "view" application -component as follows, - -~~~ -'view' => array( - 'renders' => array( - array( - 'tpl' => array( - 'class' => 'yii\renderers\SmartyRenderer', - ), - 'twig' => array( - 'class' => 'yii\renderers\TwigRenderer', - ), - ) - ), -) -~~~ +no longer supported. To use these template engines, you just need to use `tpl` as the file +extension for your Smarty views, or `twig` for Twig views. You may also configure the +`View::renderers` property to use other template engines. Models From 647a80278277ba3bf3cc0f4dc19cdc44f88d8ae2 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 6 May 2013 20:33:03 -0300 Subject: [PATCH 2/3] Added dirty attribute description. --- docs/guide/upgrade-from-v1.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index 5da5254..3b24201 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -377,6 +377,11 @@ $customers = Customer::find()->asArray()->all(); ~~~ +By default, ActiveRecord now only saves dirty attributes. In 1.1, all attributes +would be saved to database when you call `save()`, regardless they are changed or not, +unless you explicitly list the attributes to save. + + Auto-quoting Table and Column Names ------------------------------------ From ce1e725a6bba4ceb0795bac3ecc8c35052e4146c Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 6 May 2013 21:20:26 -0300 Subject: [PATCH 3/3] Added namespace section. --- docs/guide/upgrade-from-v1.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/guide/upgrade-from-v1.md b/docs/guide/upgrade-from-v1.md index 3b24201..b9365e5 100644 --- a/docs/guide/upgrade-from-v1.md +++ b/docs/guide/upgrade-from-v1.md @@ -6,6 +6,17 @@ We hope this list will make it easier for you to upgrade from Yii 1.1 and quickl master Yii 2.0 based on your existing Yii knowledge. +Namespace +--------- + +The most obvious change in Yii 2.0 is the use of namespaces. Almost every core class +is namespaced, e.g., `yii\web\Request`. The "C" prefix is no longer used in class names. +The naming of the namespaces follows the directory structure. For example, `yii\web\Request` +indicates the corresponding class file is `web/Request.php` under the Yii framework folder. +You can use any core class without explicitly include that class file, thanks to the Yii +class loader. + + Component and Object --------------------