Browse Source

Correct table name in docs (#15754)

* Correct table name in docs

With this PR, the micro-framework guide is actually followable :)

* Fixed inconsistency in post table name [skip ci]
tags/2.0.14.1
Thomas Roos 7 years ago committed by Alexander Makarov
parent
commit
5a5f3d1bd9
  1. 6
      docs/guide/tutorial-yii-as-micro-framework.md

6
docs/guide/tutorial-yii-as-micro-framework.md

@ -142,7 +142,7 @@ to the application configuration:
> Info: We use an sqlite database here for simplicity. Please refer to the [Database guide](db-dao.md) for more options.
Next we create a [database migration](db-migrations.md) to create a posts table.
Next we create a [database migration](db-migrations.md) to create a post table.
Make sure you have a separate configuration file as explained above, we need it to run the console commands below.
Running the following commands will
create a database migration file and apply the migration to the database:
@ -163,12 +163,12 @@ class Post extends ActiveRecord
{
public static function tableName()
{
return '{{posts}}';
return '{{post}}';
}
}
```
> Info: The model created here is an ActiveRecord class, which represents the data from the `posts` table.
> Info: The model created here is an ActiveRecord class, which represents the data from the `post` table.
> Please refer to the [active record guide](db-active-record.md) for more information.
To serve posts on our API, add the `PostController` in `controllers`:

Loading…
Cancel
Save