| Page |
Current |
Should be |
| foreword |
thorough a review |
a thorough review |
| 16 |
// $event argument here is CEvent instance that
// was created passed when an event method was called.
// This time it was happened inside of
// CModel::afterValidate(). |
|
| 21 |
$url = $this->getUrl($songTitle); |
$url = $this->getRequestUrl($songTitle); |
| 23 |
throw new ChttpException(400); |
throw new CHttpException(400); |
| 33 |
if(Yii::app()->request->isAjaxRequest)s |
if(Yii::app()->request->isAjaxRequest) |
| 41, 45 |
// uncomment the following to enable URLs in path-format
/* |
// uncomment the following to enable URLs in path-format |
| 43 |
echo $this->createUrl('website/page', 'alias' => 'about'); |
echo $this->createUrl('website/page', array('alias' => 'about')); |
| 43 |
echo $this->createAbsoluteUrl('website/page', 'alias' => 'test'); |
echo $this->createAbsoluteUrl('website/page', array('alias' => 'test')); |
| 47 |
http://example.com/posts/ASC
// success |
http://example.com/posts/ASC |
| 58 (2nd) |
$this->redirect('post/index'); |
$this->controller->redirect('post/index'); |
| 59 |
$this->redirect('post/index'); |
$this->controller->redirect('post/index'); |
| 66 |
$this->renderPartial('////common/youtube', array( |
$this->renderPartial('//common/youtube', array( |
| 72 |
 |
 |
| 77 |
In the index action, we use |
In the index view, we use |
| 81 |
Unfortunately Facebook changed APIs slightly and the
"Managing assets" recipe got broken. The way assets are managed in the
recipe is still correct. |
| 82 |
'loadingImageUrl' => $this->loadingImageUrl,, |
'loadingImageUrl' => $this->loadingImageUrl, |
| 83 |
</p><p>"+this.location |
</p><p>"+this.location+ |
| 87 |
Yii::app()->registerCss('myCSS', 'body {margin: 0; padding: 0}', 'all'); |
Yii::app()->clientScript->registerCss('myCSS', 'body {margin: 0; padding: 0}', 'all'); |
| 87 |
Yii::app()->clientScript->registerScript('myscript', 'echo"Hello, world!";', CClientScript::POS_READY); |
Yii::app()->clientScript->registerScript('myscript', 'alert("Hello, world!");', CClientScript::POS_READY); |
| 93 |
Yii::app()->clientScript->registerScript('appConfig', "var config = ".$config.";",CClientScript::POS_HEAD);); |
Yii::app()->clientScript->registerScript('appConfig', "var config = ".$config.";",CClientScript::POS_HEAD); |
| 96 |
Now, the pretected/views/task/index.php view: |
Now, the protected/views/task/index.php view: |
| 104 |
then you get Please upload file first |
then you get Please upload a File |
| 109 |
$files=CUploadedFile::getInstance($model,'file'); |
$files=CUploadedFile::getInstances($model,'file'); |
| 116 |
return $code-$rand.»+».$rand; |
return $code-$rand."+".$rand; |
| 117 |
public $valueTo; |
public $valueTo;
protected function hasModel()
{
return $this->model instanceof CModel && $this->attributeFrom!==null && $this->attributeTo!==null;
}
|
| 129 |
'~\[~\[b\](.*)\[/b\]~i' => '<strong>$1</strong>', |
'~\[b\](.*)\[/b\]~i' => '<strong>$1</strong>', |
| 142 |
cd path/to/checked/out/code/tests/ phpunit --coverage-html reports framework/base |
cd path/to/checked/out/code/tests/ phpunit --coverage-html report framework/base |
| 148 |
Use Gii to create models actor and field tables |
Use Gii to create models actor and film tables |
| 152 |
With actionSql, we do the same except two things: we pass SQL directly instead of adding its
parts one by one and we escape values manually with Yii::app()->db->quoteValue
before using them in the query string. |
With actionSql, we do the same except we pass SQL directly instead of adding its
parts one by one. It worth mentioning that we should escape parameter values manually with Yii::app()->db->quoteValue
before using them in the query string. |
| 153 |
Link to database.ar in “There's more…” section listed twice. |
|
| 162 |
By using a regular expression, we replace everything that looks like a URL with a link
that uses this URL and calls the parent implementation, so real events are raised properly. |
By using a regular expression, we replace everything that looks like a URL with a link
that uses this URL and are calling the parent implementation, so real events are raised properly. |
| 167 |
$models = Snippet::model()->findAll(); |
$models = Snippet::model()->findAll($criteria); |
| 171 |
We need to store these, as we need them when we edit the the snippet. |
We need to store these, as we need them when we edit the snippet. |
| 173 |
protected function beforeValidate()
{
if($this->getIsNewRecord())
$this->created_on = time();
$this->modified_on = time();
return true;
}
|
protected function beforeValidate()
{
if($this->getIsNewRecord())
$this->created_on = time();
$this->modified_on = time();
return parent::beforeValidate();
}
|
| 199 |
itemView specifies a view partially used to render each data row. |
itemView specifies a view partial used to render each data row. |
| 208 |
This is the exact copy of the method named CDataProvider. |
This is the exact copy of the same named method from CDataProvider. |
| 214 |
To use fixtures, the test class should be inherited from CDbTestCase and have
public
$fixtures declared: |
To use fixtures, the test class should be inherited from CDbTestCase and have
protected
$fixtures declared: |
| 243 |
Now we need to connect view rendered to application. |
Now we need to connect view renderer to application. |
| 260 |
Run the index action again and check protected/runtime/error. |
Run the index action again and check protected/runtime/errors. |
| 316 |
Therefore, if we add indexes for
tbl_post.status
and
tbl_post.create_time, it will improve
SELECT performance, as shown in
the following screenshot: |
Therefore, if we add indexes for
tbl_comment.status
and
tbl_comment.create_time, it will improve
SELECT performance, as shown in
the following screenshot: |
| 342 |
Now, we have a custom directory named protected. |
Now, we have a custom directory named app. |
| 350, 352, 355, 356 |
protected/configs |
protected/config |
| 356 |
else if($_SERVER['HTTP_HOST']=='example.local') |
else |