/** * Finds the MedioPago model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return MedioPago the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = MedioPago::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/* @var $this yii\web\View */ /* @var $model app\models\Pago */ $this->title = Yii::t('app', 'Registrar Pago'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Pagos'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="pago-create"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php echo $this->render('_form', ['model' => $model, 'model_detalle_academia' => $model_detalle_academia, 'valor_a_pagar' => $valor_a_pagar, 'periodo_a_pagar' => $periodo_a_pagar, 'meses_a_pagar' => $meses_a_pagar]); ?> <h1><?php echo Html::encode("Historial de Pagos"); ?> </h1> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'fecha_pago:date', ['attribute' => 'medio', 'value' => function ($d) { return MedioPago::findOne(['id' => $d->medio])->nombre; }], 'valor:currency', 'comprobante', 'info:ntext', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>