34 lines
731 B
PHP
34 lines
731 B
PHP
<?php
|
|
|
|
|
|
namespace app\models\parsed;
|
|
|
|
|
|
use app\models\Slides;
|
|
|
|
class SlidesParsed
|
|
{
|
|
public $title;
|
|
public $text;
|
|
public $relation;
|
|
public $image;
|
|
|
|
public function __construct(Slides $model)
|
|
{
|
|
|
|
switch (\Yii::$app->language) {
|
|
default:
|
|
$this->title = $model->title;
|
|
$this->text = $model->text;
|
|
$this->relation = $model->relation;
|
|
break;
|
|
case 'en':
|
|
$this->title = $model->ts_en_title;
|
|
$this->text = $model->ts_en_text;
|
|
$this->relation = $model->ts_en_relation;
|
|
}
|
|
|
|
$this->image = $model->getSrcOfSingleImage('slide_home_page_image', '16:10');
|
|
}
|
|
}
|