Skip to content

Commit a1b63ba

Browse files
arogachevsamdark
authored andcommitted
Fixed getting of $post (#192)
* Added missing parentheses for where method yiisoft/yii2#16313 Credits: @buttflattery * Added missing "one" method call yiisoft/yii2#16313 (comment)
1 parent e98999d commit a1b63ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/using-yii-in-third-party-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ $id = (int)$_GET['id'];
103103
// new code
104104
require 'path/to/yii_init.php';
105105

106-
$post = \app\models\Post::find()->where['id' => $id];
106+
$post = \app\models\Post::find()->where(['id' => $id])->one();
107107

108108
echo Html::encode($post->title);
109109
```

0 commit comments

Comments
 (0)