#998 - Скрывать страницы от пользователей

parent 3592caee
......@@ -2,12 +2,13 @@
namespace common\components;
use common\modules\languages\models\Languages;
use common\modules\content\models\CoContent;
class UrlManager extends \yii\web\UrlManager {
public function parseRequest($request)
{
$pages = \common\modules\content\models\CoContent::find()->all();
$pages = CoContent::find()->where(['active' => true])->all();
$rules = [];
foreach($pages as $page)
......
......@@ -3,7 +3,10 @@ use \common\modules\content\models\CoContent;
use yii\helpers\Html;
$models = CoContent::find()
->where(['category_id' => 4])
->where([
'category_id' => 4,
'active' => true
])
->orderBy('id DESC')
->all();
?>
......
......@@ -3,9 +3,15 @@ use \common\modules\content\models\CoContent;
use yii\helpers\Html;
use yii\helpers\Url;
$models = CoContent::find()->where(['category_id' => 5])->orderBy('id DESC')->all();
$models = CoContent::find()->where([
'category_id' => 5,
'active' => true
])->orderBy('id DESC')->all();
$cases = CoContent::find()->where(['category_id' => 4]);
$cases = CoContent::find()->where([
'category_id' => 4,
'active' => true
]);
?>
<?php if($models) : ?>
<div class="row">
......
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