public $js = [
// 'js/jquery.js',
// 'js/bootstrap.min.js',
'js/jquery.scrollUp.min.js',
'js/price-range.js',
'js/jquery.prettyPhoto.js',
'js/main.js',
'js/jquery.cookie.js',
'js/jquery.accordion.js',
];
$booking = Stub::make('Booking', [
'getBookingOptions' => function () { return [new BookingOption()]; }
]);
Countries::find()->findActiveAll($limit);
Towns::find()->findActiveAll($limit);
<?php
class BaseController extends \yii\web\Controller
{
private $_support;
public function beforeAction($action)
{
if (!parent::beforeAction($action)) {
return false;
}
$support = new ContactForm();
$this->_support = $support;
if ($support->load(Yii::$app->request->post())
&& $support->contact(Yii::$app->params['adminEmail'])) {
Yii::$app->session->setFlash('contactFormSubmitted');
return $this->refresh();
}
return true;
}
public function renderContent($content)
{
$layoutFile = $this->findLayoutFile($this->getView());
if ($layoutFile !== false) {
$layoutParams = [
'content' => $content,
'support' => $this->_support
];
return $this->getView()->renderFile($layoutFile, $layoutParams, $this);
} else {
return $content;
}
}
}