fix blocks

parent c3f77ec5
...@@ -9,13 +9,14 @@ class UrlManager extends \yii\web\UrlManager { ...@@ -9,13 +9,14 @@ class UrlManager extends \yii\web\UrlManager {
{ {
$pages = \common\modules\content\models\CoContent::find()->all(); $pages = \common\modules\content\models\CoContent::find()->all();
$rules = []; $rules = [];
foreach($pages as $page) foreach($pages as $page)
{ {
$rules[$page->url.'/<id:\d+>'] = 'content/page/view/'.$page->id;
$rules['<page:('.$page->url.')>'] = 'content/page/view'; $rules['<page:('.$page->url.')>'] = 'content/page/view';
} }
$this->addRules($rules, false); $this->addRules($rules, false);
//die(print_r($request->getPathInfo()));
return parent::parseRequest($request); return parent::parseRequest($request);
} }
......
...@@ -108,10 +108,13 @@ class CoContentLang extends \common\components\ActiveRecordModel ...@@ -108,10 +108,13 @@ class CoContentLang extends \common\components\ActiveRecordModel
foreach($blocks as $block) foreach($blocks as $block)
{ {
$arrWhatReplace[] = '{' . $block->name . '}'; if($block->lang)
$arrReplace[] = $block->lang->text; {
$arrWhatReplaceNext[] = '[' . $block->name . ']'; $arrWhatReplace[] = '{' . $block->name . '}';
$arrReplaceNext[] = $block->lang->text; $arrReplace[] = $block->lang->text;
$arrWhatReplaceNext[] = '[' . $block->name . ']';
$arrReplaceNext[] = $block->lang->text;
}
} }
$arrWhatReplaceNext[] = '[about-reviews]'; $arrWhatReplaceNext[] = '[about-reviews]';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment