示例#1
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Bnpk */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Bnpks', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<a href='javascript:history.go(-1)' class="btn btn-warning">Quay lại trang trước</a>
<a href="<?php 
echo Yii::$app->request->baseUrl;
?>
/bnpk?benhan=<?php 
echo \app\models\Bnpk::findOne(['id' => $_GET['id']])->maBA;
?>
"  class="btn btn-success">Danh sách các lượt khám</a>

<div class="bnpk-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
示例#2
0
 /**
  * Finds the Bnpk model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Bnpk the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Bnpk::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }