return $content; } /** * Process settings array */ public function settingsPreparation() { foreach($this->optionsSlick as $optionKey => $optionValue) { /** * Convert int to boolean values */ if( in_array($optionKey, ['dots', 'arrows', 'infinite', 'autoplay', 'mobileFirst', 'fade']) ) { $this->optionsSlick[$optionKey] = (bool)$optionValue; continue; } /** * Look for integer values
/** * Process settings array */ public function settingsPreparation() { foreach($this->optionsSlick as $optionKey => $optionValue) { /** * Convert int to boolean values */ if( in_array($optionKey, ['dots', 'arrows', 'infinite', 'autoplay', 'mobileFirst', 'fade']) ) { $this->optionsSlick[$optionKey] = (bool)$optionValue; continue; }
* @return string * @throws \Exception */ public function run() { // var_dump($this->optionsSlick); $this->settingsPreparation(); // var_dump($this->optionsSlick); exit; $this->view->registerJs($this->registerBeforeJS); SlickWidget::widget([ 'container' => '#' . $this->optionsWrapper['id'],
try { /* @var $widget Widget */ $config['class'] = get_called_class(); $widget = Yii::createObject($config); $out = ''; if ($widget->beforeRun()) { $result = $widget->run(); $out = $widget->afterRun($result); } } catch (\Exception $e) { // close the output buffer opened above if it has not been closed already if (ob_get_level() > 0) { ob_end_clean();
if (isset($widgets[$widget_name]['data'])) { /** @var WidgetDataInterface $widgetData */ $widgetData = Yii::createObject($widgets[$widget_name]['data']); $data = $widgetData->getData($widget['id']); $options = $data + $options; } $params[$widget['full_name']] = $widget_class::widget($options); } elseif (YII_DEBUG) { throw new ErrorException("Class '$widget_class' not found", 500); } else { Yii::warning("Class '$widget_class' not found"); $params[$widget['full_name']] = ''; }
return $content; } public static function renderContent($content, $params = []) { return static::renderWidgets($content, Yii::$app->params['widgets'], $params); } }
$template = Template::find()->where(['name' => $this->defaultTemplate])->one(); $content = ViewHelper::render($this->getFullContent($template), [ 'content' => $this->renderPartial($layout, $data) ]); return $this->renderContent(ViewHelper::renderContent($content)); } /** * @param Template $model * * @return mixed
} // Render page $template = \Yii::$app->devicedetect->isMobile() && ! \Yii::$app->devicedetect->isTablet() ? "solution_mobile" : "solution"; return $this->renderPageContent($template, [ 'item' => $item ]); } /** * Render page content * * @param $layout
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); if ($oldController !== null) { Yii::$app->controller = $oldController; } return $result; }
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } $response = $this->getResponse(); if ($result !== null) {
{ try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'slug' => 'tokens', ];