<?php
$list = Navigations::getTreeList();
$list[] = 'новый option';
?>
<?= $form->field($model->main, 'parent_id', ['labelOptions' => ['class' => 'control-label col-md-3']])->dropDownList($list, ['class' => 'form-control', ]); ?>
var height = 10;
$('.iframe-letters').each(function () {
$('#resize-down-height').click(function () {
height += 100
$('.iframe-letters').css('height', height)
})
});
https://jsfiddle.net/9b08ct1k/ [
'attribute'=> 'body',
'value' => function($model){return strip_tags($model->body);},
],
public function getPureBody(){
return strip_tags($this->body); //тут же можно добавить обрезку по длинный, если это длинный текст
}
'columns' => [
[
'attribute'=> 'body',
'value' => 'pureBody'},
],
]
'columns' => [
'pureBody'
]
<?php
namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public function init()
{
$format = 'theme/assets/global/plugins/date/locales/dater.%s.min.js';
$this->js[] = sprintf($format, \Yii::$app->language);
}
}
$returnHtml = "<div class='form-group field-users-created_at required'>";
for($i = 0; $i < count($items); $i++){
$returnHtml .= Html::beginTag('label', $labelOptions).$items[$i].Html::Tag('input','',$options)."<span></span>".Html::endTag('label');
}
$returnHtml .= "<span class='help-block'></span></div>";
return $returnHtml;
$html = "<div class='form-group field-users-created_at required'>";
foreach ($items as $item) {
$html .= Html::beginTag('label', $labelOptions) .
$item .
Html::Tag('input','',$options).
"<span></span>".
Html::endTag('label');
}
$html .= "<span class='help-block'></span></div>";
return $html;
public function radioList($items, $options = [])
{
if (key_exists('item', $options) === false) {
$options['item'] = function($label, $name){
return "<label class='mt-radio mt-radio-outline'>$name<input type='radio' value='1' name='optionsRadios'> <span></span></label>"
}
}
return parent::__radioList($items, $options);
}
<?=$form->field($model,'created_at')->myRadioList()?>
<?=$form->field($model,'created_at')->myRadioWidget()?>