コード例 #1
0
ファイル: view.php プロジェクト: aitanz/BienesPublicos_
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Volver'), ['create'], ['class' => 'btn btn-info']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Update'), ['update', 'id_codigo' => $model->id_codigo, 'id_direccion' => $model->id_direccion, 'identificacion' => $model->identificacion], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id_codigo' => $model->id_codigo, 'id_direccion' => $model->id_direccion, 'identificacion' => $model->identificacion], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => [['attribute' => 'nombre', 'value' => BienesCodigo::findOne($model->id_codigo)->descripcion], ['attribute' => 'Sede', 'value' => BienesSede::findOne($model->id_sede)->nombre], 'identificacion', 'descripcion', 'valor_unidad', 'justiprecio', 'ano_adquisicion', 'ubicacion', ['attribute' => 'tipo_adquisicion', 'value' => app\modules\bienes\models\BienesAdquisicion::findOne($model->tipo_adquisicion)->descripcion]]]);
?>

</div>
<style>
.btn-info::before {
	/*--ajuste de icono de crear--*/
    content: "\f0a8 ";
    font-family: FontAwesome;
    color: #5A5A5B;

}
</style>
コード例 #2
0
 /**
  * Finds the BienesSede model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return BienesSede the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = BienesSede::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }