Merge pull request #4101 from qiansen1386/patch-10

fix duplicated white space and typo [skip ci]
This commit is contained in:
Alexander Makarov
2014-06-28 19:39:16 +04:00

View File

@@ -9,7 +9,7 @@ to a `label` property. You could use the following code to achieve this task:
$object->label = trim($label); $object->label = trim($label);
``` ```
The drawback of the above code is that you have to call `trim()` everywhere in your code where you met set the `label` The drawback of the above code is that you have to call `trim()` everywhere in your code where you might set the `label`
property. If in the future, the `label` property gets a new requirement, such as the first letter must be captialized, you would again have to modify every bit of code that assigns a value to `label`. The repetition of code leads to bugs and is a practice you want to avoid as much as possible. property. If in the future, the `label` property gets a new requirement, such as the first letter must be captialized, you would again have to modify every bit of code that assigns a value to `label`. The repetition of code leads to bugs and is a practice you want to avoid as much as possible.
To solve this problem, Yii introduces a base class called [[yii\base\Object]] that supports defining properties To solve this problem, Yii introduces a base class called [[yii\base\Object]] that supports defining properties