*/ protected function _load_image() { if ( ! is_resource($this->_image)) { // Gets create function $create = $this->_create_function; // Open the temporary image $this->_image = $create($this->file); // Preserve transparency when saving imagesavealpha($this->_image, TRUE); } } /** * Execute a resize. *
if ( ! is_resource($this->_image)) { // Gets create function $create = $this->_create_function; // Open the temporary image $this->_image = $create($this->file); // Preserve transparency when saving imagesavealpha($this->_image, TRUE); } }
{ // Presize width and height $pre_width = $this->width; $pre_height = $this->height; // Loads image if not yet loaded $this->_load_image(); // Test if we can do a resize without resampling to speed up the final resize if ($width > ($this->width / 2) AND $height > ($this->height / 2)) { // The maximum reduction is 10% greater than the final size $reduction_width = round($width * 1.1);
$this->_do_adapt($image_width, $image_height, $bg_width, $bg_height, $offset_x, $offset_y); } // The quality must be in the range of 1 to 100 $quality = min(max($quality, 1), 100); $this->_do_resize($width, $height, $quality); return $this; } /** * Crop an image to the given size. Either the width or the height can be
if ($siteConfig['mono']) $brand['url'] = str_replace(\app\components\CController::$monoBrand['url'] . '/', Yii::$app->params['replace-url'], $brand['url']); $path = Yii::getAlias('@frontend') . '/web/uploads/images/'; $file = $path . $brand['image']; if (!is_file($path . 'thumbs/' . $brand['image']) && is_file($file)) { $image = Yii::$app->image->load($file); $image->resize(133, 117)->background('#fff', 100)->save($path . 'thumbs/' . $brand['image'], 60); } ?> <li class="Menyu-itm"> <a class="Menyu-sslk" href="/<?= $brand['url']; ?>"> <?php if (!Yii::$app->params['devicedetect']['isMobile']): ?> <div class="img">
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidCallException if the view cannot be resolved. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter.
* @param array $params the parameters (name-value pairs) that should be made available in the view. * @return string the rendering result. * @throws InvalidArgumentException if the view file does not exist. */ public function render($view, $params = []) { return $this->getView()->render($view, $params, $this); } /** * Renders a view file. * @param string $file the view file to be rendered. This can be either a file path or a [path alias](guide:concept-aliases). * @param array $params the parameters (name-value pairs) that should be made available in the view.
); $firstLatter = mb_substr($row['title'], 0, 1, 'utf8'); $sortedRows[$firstLatter][] = $row; } if (is_array($this->brand)) $this->brand = $this->brand['title']; return $this->render('models', ['sortedBrands' => $sortedRows, 'brand2' => $this->brand, 'searches' => $searches, 'rows' => $rows]); } }
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();
<?= kofe03\widgets\lists\Neispravnost::widget(['type' => 2, 'is_popular' => true, 'title' => 'Цены по неисправностям']); ?> <?= kofe03\widgets\lists\Neispravnost::widget(['type' => 1, 'is_popular' => true, 'title' => 'Цены по услугам']); ?> <?= kofe03\widgets\lists\Neispravnost::widget(['type' => 1, 'is_popular' => false, 'title' => 'Цены по прочим услугам', 'dopClass' => 'other-table']); ?> <section class="office-content"> <div class="office__inner"> <h2 style="margin:20px 0 0 0;">Профессиональный ремонт моделей <?= $pageInfo['title']; ?></h2> <?= kofe03\widgets\lists\Models::widget(['parent' => $pageInfo['id'], 'brand' => $pageInfo]); ?> <div class="ommabob__harakati"> <a class="reviews__all show-model" href="#">Показать остальные модели</a> </div> </div> </section>
{ $_obInitialLevel_ = ob_get_level(); ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); try { require $_file_; return ob_get_clean(); } catch (\Exception $e) { while (ob_get_level() > $_obInitialLevel_) { if (!@ob_end_clean()) { ob_clean(); }
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidCallException if the view cannot be resolved. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the [path alias](guide:concept-aliases) of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @return string the rendering result. * @throws InvalidArgumentException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered
$model = \Yii::$app->db->createCommand($sql)->bindValues(['parent' => $pageInfo['id']])->queryOne(); if (empty($model)) { $sql = 'select image from {{%pages}} where parent =:parent and active = 1 order by id limit 1'; $model = \Yii::$app->db->createCommand($sql)->bindValues(['parent' => $pageInfo['id']])->queryOne(); } return $this->render('brand', ['pageInfo' => $pageInfo, 'model' => $model, 'title' => $title]); } public function actionModel() { $siteConfig = self::getSiteConfig(); if ($siteConfig['id'] == 113) { $url = Yii::$app->request->pathInfo;
$args = $this->controller->bindActionParams($this, $params); Yii::debug('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::debug("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 = [ 'data' => [ 'id' => '13758', 'title' => 'Severin', 'url' => 'remont-kofemashin-severin', 'description' => 'Организация по восстановлению кофейных машин Severin реализует техническое и диагностическое обслуживание по демократичной цене и минимальным срокам. Наше предприятие предлагает заказчикам сервисные услуги по европейским стандартам качества, так что Вы можете быть спокойны за свой аппарат. Мы имеем в наличии детали, закупаемые у проверенных дилеров, с которыми сотрудничаем с момента основания компании. В фирме работает отдел курьеров, который транспортирует кофеаппараты по согласованию с заказчиком. Контактные номера расположены на сайте, а так-же присутствует онлайн-форма для соединения со специалистом и для заказа услуг курьера.', 'full_description' => '', 'active' => '1', 'sort' => '9999', 'meta_key' => '', 'meta_desc' => '', 'meta_title' => '', 'meta_h1' => '', 'image' => '', 'type' => 'brand', 'date' => null, 'action' => 'list/brand', 'parent' => '4', 'full_title' => null, 'icon' => null, 'yandexId' => '242454', 'site_id' => '0', 'category_id' => '7', ], ]; $_SESSION = [ '__flash' => [], 'region' => [ 'id' => 1, 'title' => 'Москва и область', 'phone' => '8 (495) 135-00-03', 'titleRod' => 'Москве', 'titleRod2' => 'МСК', 'class' => 'moskva', ], ];