fix blocks

parent c3f77ec5
......@@ -9,13 +9,14 @@ class UrlManager extends \yii\web\UrlManager {
{
$pages = \common\modules\content\models\CoContent::find()->all();
$rules = [];
foreach($pages as $page)
{
$rules[$page->url.'/<id:\d+>'] = 'content/page/view/'.$page->id;
$rules['<page:('.$page->url.')>'] = 'content/page/view';
}
$this->addRules($rules, false);
//die(print_r($request->getPathInfo()));
return parent::parseRequest($request);
}
......
......@@ -107,12 +107,15 @@ class CoContentLang extends \common\components\ActiveRecordModel
$blocks = CoBlocks::find()->all();
foreach($blocks as $block)
{
if($block->lang)
{
$arrWhatReplace[] = '{' . $block->name . '}';
$arrReplace[] = $block->lang->text;
$arrWhatReplaceNext[] = '[' . $block->name . ']';
$arrReplaceNext[] = $block->lang->text;
}
}
$arrWhatReplaceNext[] = '[about-reviews]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('about-reviews', true);
......
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