Exemplo n.º 1
0
<?php

use yii\helpers\Html;
use yii\bootstrap\Tabs;
use app\models\Raptor;
/* @var $this yii\web\View */
/* @var $model app\models\Incident */
$this->title = 'Create Incident - ' . Raptor::findOne($incident->raptor_id)->species_long;
$this->params['breadcrumbs'][] = ['label' => 'Incidents', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="incident-create">

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

    <?php 
echo Tabs::widget(['items' => [['label' => 'Incident', 'content' => $this->render('_form', ['incident' => $incident]), 'active' => true]]]);
?>

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