public function getTipoAcervoPadre()
 {
     $padre = TipoAcervo::findOne($this->tipoAcervo_id);
     //   $this->hasOne(TipoAcervo::className(), ['id'=> $this->tipoAcervo_id]);
     //var_dump($padre);
     if (!isset($padre)) {
         return "";
     }
     return $padre->descripcion;
 }
use kartik\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\builder\Form;
/* @var $this yii\web\View */
/* @var $model app\models\TipoAcervo */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="tipo-acervo-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_VERTICAL]);
?>

    <?php 
$dataTipoAcervo = ArrayHelper::map(\app\models\TipoAcervo::find()->where(['is', 'tipoAcervo_id', NULL])->asArray()->all(), 'id', 'descripcion');
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 2, 'attributes' => ['descripcion' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Descripcion...']], 'tipoAcervo_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataTipoAcervo], 'pluginOptions' => ['allowClear' => true], 'hint' => 'Seleccione la colección a la que pertenece el acervo']]]);
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTipoAcervo()
 {
     return $this->hasOne(TipoAcervo::className(), ['id' => 'tipoAcervo_id']);
 }
echo $form->field($model, 'publicar_id')->widget(SwitchInput::classname(), ['pluginOptions' => ['onText' => 'Si', 'offText' => 'No'], 'inlineLabel' => false]);
?>
        </div>
  

    </div>
   
    
    <?php 
echo Html::hiddenInput('fechaIngreso', $model->fechaIngreso);
echo Html::hiddenInput('ingreso_id', $model->ingreso_id);
$dataForma = ArrayHelper::map(\app\models\FormaIngreso::find()->asArray()->all(), 'id', 'nombre');
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 6, 'attributes' => ['nroA' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Número A..', 'addon' => ['append' => ['content' => '.00']]]], 'nroB' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Número B..']], 'nroC' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Número C..']], 'nroD' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Número D..']], 'descEpoca' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Epoca...']], 'codformaing' => ['type' => Form::INPUT_WIDGET, 'label' => 'Tipo de Ingreso', 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataForma]]]]);
$dataCopia = ArrayHelper::map(\app\models\Copia::find()->asArray()->all(), 'id', 'nombre');
$dataEstado = ArrayHelper::map(\app\models\Estado::find()->asArray()->all(), 'id', 'nombre');
$dataTipo = ArrayHelper::map(\app\models\TipoAcervo::find()->asArray()->all(), 'id', 'descripcion');
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 6, 'attributes' => ['tipoAcervo_id' => ['type' => Form::INPUT_WIDGET, 'label' => 'Tipo de Acervo', 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataTipo]], 'copia_id' => ['type' => Form::INPUT_WIDGET, 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataCopia]], 'estado_id' => ['type' => Form::INPUT_WIDGET, 'label' => 'Estado', 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataEstado]], 'material' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Material...']], 'forma' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Forma...']], 'color' => ['type' => Form::INPUT_TEXT, 'options' => ['placeholder' => 'Color...']]]]);
$dataUbicacion = ArrayHelper::map(\app\models\Ubicacion::find()->asArray()->all(), 'id', 'nombre');
echo Form::widget(['model' => $model, 'form' => $form, 'columns' => 3, 'attributes' => ['ubicacion_id' => ['type' => Form::INPUT_WIDGET, 'label' => 'Ubicación', 'widgetClass' => '\\kartik\\widgets\\Select2', 'options' => ['data' => $dataUbicacion]], 'descUbicacion' => ['type' => Form::INPUT_TEXT, 'label' => 'Más detalles ubicación', 'options' => ['placeholder' => 'Más detalles...']], 'lugarprocac' => ['type' => Form::INPUT_TEXT, 'label' => 'Lugar de Procedencia', 'options' => ['placeholder' => 'Lugar de procedencia...']]]]);
?>
    
    <div class="row">
        <div class="col-sm-6"> 
            <?php 
echo $form->field($model, 'TemaIds')->widget(Select2::classname(), ['data' => $model->dropTema, 'options' => ['multiple' => true]]);
?>
        </div>
        <div class="col-sm-6">
            <?php 
echo $form->field($model, 'ColeccionIds')->widget(Select2::classname(), ['data' => $model->dropColeccion, 'options' => ['multiple' => true]]);
?>
 /**
  * Finds the TipoAcervo model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return TipoAcervo the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = TipoAcervo::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }