Ejemplo n.º 1
0
?>
		
		<?php 
echo $form->field($model, 'seourl')->textInput();
?>
		</div>
	</div>
	
	<div class="panel panel-default">
		<div class="panel-heading"><h4>Основной текст</h4></div>
		<div class="panel-body">
		<?//= $form->field($model, 'content')->textArea(['rows' => '4']) ?>
		
		
		<?php 
echo TinyMceWidget::widget(['content' => $model->content, 'field_id' => 'StructureRecord[content]']);
?>
		
		</div>
	</div>
	
	<div class="panel panel-default">
		<div class="panel-heading"><h4>Приложения</h4></div>
		<div class="panel-body">
		
		
		
		<?php 
echo $form->field($model, 'file')->fileInput();
?>
		<? if($model->file){ ?>
Ejemplo n.º 2
0
echo $form->field($model, 'parent_id')->hiddenInput()->label(false);
?>
 <? // one default parent param ?>
	<?}?>

	
	
	<?
	foreach($model->getDescription() as $field_name => $item){
		if($item['detail']){
			if($item['type']=='int' || $item['type']=='string'){
				echo $form->field($model, $field_name)->textInput();
			}elseif($item['type'] == 'text'){
				echo $form->field($model, $field_name)->textArea(['rows' => '4']);
			}elseif($item['type'] == 'editor'){
				echo TinyMceWidget::widget(['content' => $model->{$field_name},
											'field_id'=>$model->getShortActiveRecordName().'['.$field_name.']']);
			}elseif($item['type'] == 'datetime'){
				
				if(!in_array($field_name,['created_at','updated_at'])){
				
					echo $form->field($model, $field_name)->widget(\yii\jui\DatePicker::classname(), [
					'language' => 'ru',
					'dateFormat' => AdminFormBehavior::DATE_FORMAT,
					]);
				
				}

			}elseif($item['type'] == 'date'){
				
				if(!in_array($field_name,['created_at','updated_at'])){