Commit 46edaac375eabec14577f5c9e895d9bc41ce0e8a

Authored by Yarik
1 parent c882dc75

Namespaces

Module.php
1 1 <?php
2 2  
3   - namespace common\modules;
  3 + namespace artweb\artbox\design\modules;
4 4  
5 5 class Module extends \yii\base\Module
6 6 {
... ...
composer.json
... ... @@ -5,11 +5,12 @@
5 5 "require": {
6 6 "php": ">=7.0",
7 7 "yiisoft/yii2": "*",
8   - "developeruz/yii2-db-rbac": "*"
  8 + "artweb/artbox": "dev-master",
  9 + "artweb/artbox/language": "dev-master"
9 10 },
10 11 "autoload": {
11 12 "psr-4": {
12   - "artweb\\artbox\\seo\": ""
  13 + "artweb\\artbox\\design\": ""
13 14 }
14 15 }
15 16 }
16 17 \ No newline at end of file
... ...
controllers/BannerController.php
... ... @@ -3,8 +3,8 @@
3 3 namespace backend\controllers;
4 4  
5 5 use Yii;
6   - use common\models\Banner;
7   - use common\models\BannerSearch;
  6 + use artweb\artbox\design\models\Banner;
  7 + use artweb\artbox\design\models\BannerSearch;
8 8 use yii\web\Controller;
9 9 use yii\web\NotFoundHttpException;
10 10 use yii\filters\VerbFilter;
... ...
controllers/BgController.php
... ... @@ -3,8 +3,8 @@
3 3 namespace backend\controllers;
4 4  
5 5 use Yii;
6   - use common\models\Bg;
7   - use common\models\BgSearch;
  6 + use artweb\artbox\design\models\Bg;
  7 + use artweb\artbox\design\models\BgSearch;
8 8 use yii\web\Controller;
9 9 use yii\web\NotFoundHttpException;
10 10 use yii\filters\VerbFilter;
... ...
controllers/SliderController.php
... ... @@ -3,8 +3,8 @@
3 3 namespace backend\controllers;
4 4  
5 5 use Yii;
6   - use common\models\Slider;
7   - use common\models\SliderSearch;
  6 + use artweb\artbox\design\models\Slider;
  7 + use artweb\artbox\design\models\SliderSearch;
8 8 use yii\db\ActiveQuery;
9 9 use yii\web\Controller;
10 10 use yii\web\NotFoundHttpException;
... ...
controllers/SliderImageController.php
... ... @@ -3,10 +3,10 @@
3 3 namespace backend\controllers;
4 4  
5 5 use developeruz\db_rbac\behaviors\AccessBehavior;
6   - use common\models\Slider;
  6 + use artweb\artbox\design\models\Slider;
7 7 use Yii;
8   - use common\models\SliderImage;
9   - use common\models\SliderImageSearch;
  8 + use artweb\artbox\design\models\SliderImage;
  9 + use artweb\artbox\design\models\SliderImageSearch;
10 10 use yii\web\Controller;
11 11 use yii\web\NotFoundHttpException;
12 12 use yii\filters\VerbFilter;
... ...
models/Banner.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\modules\language\behaviors\LanguageBehavior;
  5 + use artweb\artbox\language\behaviors\LanguageBehavior;
6 6 use Yii;
7 7 use yii\db\ActiveQuery;
8 8 use yii\db\ActiveRecord;
... ...
models/BannerLang.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\behaviors\SaveImgBehavior;
6   - use common\modules\language\models\Language;
  5 + use artweb\artbox\behaviors\SaveImgBehavior;
  6 + use artweb\artbox\language\models\Language;
7 7 use Yii;
8 8 use yii\db\ActiveRecord;
9 9  
... ...
models/BannerSearch.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5 5 use yii\base\Model;
6 6 use yii\data\ActiveDataProvider;
7 7  
8 8 /**
9   - * BannerSearch represents the model behind the search form about `common\models\Banner`.
  9 + * BannerSearch represents the model behind the search form about `artweb\artbox\design\models\Banner`.
10 10 */
11 11 class BannerSearch extends Banner
12 12 {
... ...
models/Bg.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\behaviors\SaveImgBehavior;
6   - use common\modules\language\behaviors\LanguageBehavior;
  5 + use artweb\artbox\behaviors\SaveImgBehavior;
  6 + use artweb\artbox\language\behaviors\LanguageBehavior;
7 7 use yii\db\ActiveQuery;
8 8 use yii\db\ActiveRecord;
9 9 use yii\web\Request;
... ...
models/BgLang.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\modules\language\models\Language;
  5 + use artweb\artbox\language\models\Language;
6 6 use Yii;
7 7 use yii\db\ActiveRecord;
8 8  
... ...
models/BgSearch.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5 5 use yii\base\Model;
6 6 use yii\data\ActiveDataProvider;
7 7  
8 8 /**
9   - * BgSearch represents the model behind the search form about `common\models\Bg`.
  9 + * BgSearch represents the model behind the search form about `artweb\artbox\design\models\Bg`.
10 10 */
11 11 class BgSearch extends Bg
12 12 {
... ...
models/Slider.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5 5 use Yii;
6 6 use yii\db\ActiveRecord;
... ... @@ -60,7 +60,7 @@
60 60 [
61 61 'title',
62 62 'unique',
63   - 'targetClass' => '\common\models\Slider',
  63 + 'targetClass' => '\artweb\artbox\design\models\Slider',
64 64 'message' => Yii::t(
65 65 'app',
66 66 'message',
... ...
models/SliderImage.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\behaviors\SaveImgBehavior;
6   - use common\modules\language\behaviors\LanguageBehavior;
  5 + use artweb\artbox\behaviors\SaveImgBehavior;
  6 + use artweb\artbox\language\behaviors\LanguageBehavior;
7 7 use Yii;
8 8 use yii\db\ActiveQuery;
9 9 use yii\db\ActiveRecord;
... ...
models/SliderImageLang.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5   - use common\modules\language\models\Language;
  5 + use artweb\artbox\language\models\Language;
6 6 use Yii;
7 7 use yii\db\ActiveRecord;
8 8  
... ...
models/SliderImageSearch.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5 5 use yii\base\Model;
6 6 use yii\data\ActiveDataProvider;
7 7  
8 8 /**
9 9 * SliderImageSearch represents the model behind the search form about
10   - * `common\models\SliderImage`.
  10 + * `artweb\artbox\design\models\SliderImage`.
11 11 */
12 12 class SliderImageSearch extends SliderImage
13 13 {
... ...
models/SliderSearch.php
1 1 <?php
2 2  
3   - namespace common\models;
  3 + namespace artweb\artbox\design\models;
4 4  
5 5 use yii\base\Model;
6 6 use yii\data\ActiveDataProvider;
7 7  
8 8 /**
9   - * SliderSearch represents the model behind the search form about `common\models\Slider`.
  9 + * SliderSearch represents the model behind the search form about `artweb\artbox\design\models\Slider`.
10 10 */
11 11 class SliderSearch extends Slider
12 12 {
... ...
widgets/Slider.php
... ... @@ -12,14 +12,13 @@ class Slider extends Widget
12 12 parent::init();
13 13  
14 14 }
15   -
16   -
  15 +
17 16 public function run()
18 17 {
19 18  
20 19  
21   - $slider = \common\models\Slider::find()->where([\common\models\Slider::tableName().'.title'=>$this->title])->joinWith("sliderImage")->one();
22   - if($slider instanceof \common\models\Slider){
  20 + $slider = \artweb\artbox\design\models\Slider::find()->where([\artweb\artbox\design\models\Slider::tableName().'.title'=>$this->title])->joinWith("sliderImage")->one();
  21 + if($slider instanceof \artweb\artbox\design\models\Slider){
23 22 return $this->render('slider',[
24 23 'slider'=>$slider,
25 24 'title'=>$this->title
... ... @@ -30,4 +29,4 @@ class Slider extends Widget
30 29  
31 30 }
32 31  
33   -}
34 32 \ No newline at end of file
  33 +}
... ...
widgets/views/slider.php
1 1 <?php
2 2 /* @var $slider Slider*/
3   -use common\components\artboximage\ArtboxImageHelper;
4   -use common\models\Slider;
  3 +use artweb\artbox\design\components\artboximage\ArtboxImageHelper;
  4 +use artweb\artbox\design\models\Slider;
5 5 use yii\helpers\Html;
6 6 use yii\web\View;
7 7 use frontend\assets\FlipclockAsset;
... ...