Yii
7
Вклад в тег
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(web)
RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
RewriteRule ^css/(.*)$ web/css/$1 [L]
RewriteRule ^js/(.*)$ web/js/$1 [L]
RewriteRule ^images/(.*)$ web/images/$1 [L]
RewriteRule (.*) /web/$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /web/index.php
'baseUrl'=> '',
getContents()
{
return $this->hasMany(Content::className(), ['page_id' => 'id']);
}
$model = Pages::findOne($id)
$model = Pages::find()->with('contents')->where(['id'=>$id])->one()