'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
'frontUrlManager' => [
'class' => 'yii\web\urlManager',
'baseUrl' => 'http://site.ru',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => require(__DIR__ . '/../../frontend/config/routes.php'),
],
Yii::$app->frontUrlManager->createAbsoluteUrl('/img/media/product/images/'.$this->media_url);
use kartik\widgets\Select2;
$data = [
"red" => "red",
"green" => "green",
"blue" => "blue",
"orange" => "orange",
];
// Tagging support Multiple
$model->colorTags = ['red', 'green']; // initial value
echo $form->field($model, 'colorTags')->widget(Select2::classname(), [
'data' => $data,
'options' => ['placeholder' => 'Select a color ...', 'multiple' => true],
'pluginOptions' => [
'tags' => true,
'tokenSeparators' => [',', ' '],
'maximumInputLength' => 10
],
])->label('Tag Multiple');
<?= Html::csrfMetaTags() ?>
- это как раз их выводит. А задавать их нужно во вью (в view/somefolder/index.php, view/somefolder/create.php и т.д.), а не в layout (layout/some_name.php) $this->title = "мой тайтл";
$this->registerMetaTag(['name' => 'description', 'content' => 'мой супер пупер текст']);
$class = 'active';
foreach($categories as $category) {
echo '<li class="list__item '.$class.'"></li>';
if($class == 'active'){
$class = ''
}
}
foreach($categories as $key => $category) {
echo '<li class="list__item'.($key == 0)?" active":"".'"></li>';
}
Paypal говорит, что номером счета является email.
print_r($model->id_zakaz);
- это вообще никогда не выполнитсяif ($model->id_sotrud == 2) {
return 'M-'.$model->id_zakaz;
}
return $model->id_zakaz;
return ($model->id_sotrud == 2)?'M-'.$model->id_zakaz:$model->id_zakaz;
public function getMyCrazyHren(){
return ($this->id_sotrud == 2)?'M-'.$this->id_zakaz:$this->id_zakaz;
}
[
'attribute' => 'id_zakaz',
'headerOptions' => ['width' => '20'],
'value' => 'myCrazyHren',
]