Image::$thumbnailBackgroundAlpha = 0; $image = Image::thumbnail( $src, $this->width, $this->height, ManipulatorInterface::THUMBNAIL_INSET ); if (!is_dir($fileStore)) { if (!mkdir($fileStore)) { Yii::warning('Cannot create folder for images', self::className()); return 'Failed'; } } if(false === $image->save($fileStore . '/' . $pathName . '.' . $ext, ['quality' => $this->quality])){ Yii::warning('Cannot save generated image', self::className()); } } }
$this->width, $this->height, ManipulatorInterface::THUMBNAIL_INSET ); if (!is_dir($fileStore)) { if (!mkdir($fileStore)) { Yii::warning('Cannot create folder for images', self::className()); return 'Failed'; } } if(false === $image->save($fileStore . '/' . $pathName . '.' . $ext, ['quality' => $this->quality])){ Yii::warning('Cannot save generated image', self::className());
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();
'src' => is_object($image) ? '/files/' . $image->filename : null, 'emptyImage' => '/theme/2018/distr/img/clinic-alternate-002-258x258.png', 'width' => 262, 'height' => 262, 'itemProp' => 'logo', // 'asContent' => true, 'alt' => $product->getClinic()->name ]) ?> <div class="thumb"> <a href="<?= Url::to([ '/clinics/default/index', 'product' => $product->getClinic()->id ]) ?>">
{ $_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.
<div class="survey-list-item"> <?=$this->render('clinic-row', [ 'product' => $agregator, 'category' => $category, 'district' => $district, 'title' => $title, ])?> </div> <?php endforeach;?> <?php else:?> <div class="no-item">
{ $_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
'category' => $category ? $category->slug : null, 'page' => $pageNum + 1, ]) : null, 'agregators' => $agregators, 'category' => $category, 'district' => $district, 'title' => $title3, ]); } }
public $sotBy = 'name'; public $pageSize = 0; public function actionShow($district = null, $category = null){ if(is_object($category) || is_object($district)){ return $this->results($district, $category); }else{ return $this->index($district, $category); } } public function index($district = null, $category = null){
$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();
defined('YII_ENV') or define('YII_ENV', $yiiEnvironment); defined('YII_CONSOLE') or define('YII_CONSOLE', false); require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); require(__DIR__ . '/../functions.php'); (new yii\web\Application($config))->run();
$_GET = [ 'last_category_id' => null, 'category_group_id' => 3, 'parent_id' => -1, 'category' => unserialize('O:32:"app\\modules\\shop\\models\\Category":14:{s:10:"deleteMode";i:1;s:41:"' . "\0" . 'app\\modules\\shop\\models\\Category' . "\0" . 'urlPath";N;s:43:"' . "\0" . 'app\\modules\\shop\\models\\Category' . "\0" . 'parentIds";N;s:44:"' . "\0" . 'app\\modules\\shop\\models\\Category' . "\0" . 'filterSets";N;s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:21:{s:2:"id";i:122;s:17:"category_group_id";i:3;s:9:"parent_id";i:84;s:4:"name";s:23:"МРТ суставов";s:5:"title";s:23:"МРТ суставов";s:2:"h1";s:23:"МРТ суставов";s:16:"meta_description";s:23:"МРТ суставов";s:17:"breadcrumbs_label";s:23:"МРТ суставов";s:4:"slug";s:12:"mrt_sustavov";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:0:"";s:8:"announce";s:0:"";s:10:"sort_order";i:1550;s:12:"title_append";s:0:"";s:6:"active";i:1;s:10:"date_added";s:19:"2017-02-22 15:50:58";s:13:"date_modified";s:19:"2017-06-28 15:50:57";s:11:"property_id";i:0;s:17:"property_group_id";i:171;s:3:"fts";s:33:"\'1\' \'мрт\':1A \'сустав\':2A";}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:21:{s:2:"id";i:122;s:17:"category_group_id";i:3;s:9:"parent_id";i:84;s:4:"name";s:23:"МРТ суставов";s:5:"title";s:23:"МРТ суставов";s:2:"h1";s:23:"МРТ суставов";s:16:"meta_description";s:23:"МРТ суставов";s:17:"breadcrumbs_label";s:23:"МРТ суставов";s:4:"slug";s:12:"mrt_sustavov";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:0:"";s:8:"announce";s:0:"";s:10:"sort_order";i:1550;s:12:"title_append";s:0:"";s:6:"active";i:1;s:10:"date_added";s:19:"2017-02-22 15:50:58";s:13:"date_modified";s:19:"2017-06-28 15:50:57";s:11:"property_id";i:0;s:17:"property_group_id";i:171;s:3:"fts";s:33:"\'1\' \'мрт\':1A \'сустав\':2A";}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:0:{}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:0:{}s:23:"' . "\0" . 'yii\\base\\Model' . "\0" . '_errors";N;s:27:"' . "\0" . 'yii\\base\\Model' . "\0" . '_validators";N;s:25:"' . "\0" . 'yii\\base\\Model' . "\0" . '_scenario";s:7:"default";s:27:"' . "\0" . 'yii\\base\\Component' . "\0" . '_events";a:6:{s:11:"afterDelete";a:2:{i:0;a:2:{i:0;a:2:{i:0;O:47:"devgroup\\TagDependencyHelper\\ActiveRecordHelper":2:{s:5:"cache";s:5:"cache";s:5:"owner";r:1;}i:1;s:14:"invalidateTags";}i:1;N;}i:1;a:2:{i:0;a:2:{i:0;O:18:"app\\behaviors\\Tree":6:{s:11:"idAttribute";s:2:"id";s:17:"parentIdAttribute";s:9:"parent_id";s:9:"sortOrder";a:2:{s:10:"sort_order";i:4;s:2:"id";i:4;}s:15:"cascadeDeleting";b:0;s:15:"activeAttribute";s:6:"active";s:5:"owner";r:1;}i:1;s:11:"afterDelete";}i:1;N;}}s:11:"afterInsert";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:59;i:1;s:14:"invalidateTags";}i:1;N;}}s:11:"afterUpdate";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:59;i:1;s:14:"invalidateTags";}i:1;N;}}s:12:"beforeDelete";a:1:{i:0;a:2:{i:0;a:2:{i:0;O:28:"app\\behaviors\\CleanRelations":1:{s:5:"owner";r:1;}i:1;s:16:"cleanUpRelations";}i:1;N;}}s:12:"beforeInsert";a:1:{i:0;a:2:{i:0;a:2:{i:0;O:31:"yii\\behaviors\\TimestampBehavior":7:{s:18:"createdAtAttribute";s:10:"date_added";s:18:"updatedAtAttribute";s:13:"date_modified";s:5:"value";O:17:"yii\\db\\Expression":2:{s:10:"expression";s:5:"NOW()";s:6:"params";a:0:{}}s:10:"attributes";a:2:{s:12:"beforeInsert";a:1:{i:0;s:10:"date_added";}s:12:"beforeUpdate";a:1:{i:0;s:13:"date_modified";}}s:17:"skipUpdateOnClean";b:1;s:22:"preserveNonEmptyValues";b:0;s:5:"owner";r:1;}i:1;s:18:"evaluateAttributes";}i:1;N;}}s:12:"beforeUpdate";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:99;i:1;s:18:"evaluateAttributes";}i:1;N;}}}s:35:"' . "\0" . 'yii\\base\\Component' . "\0" . '_eventWildcards";a:0:{}s:30:"' . "\0" . 'yii\\base\\Component' . "\0" . '_behaviors";a:5:{i:0;O:28:"app\\properties\\HasProperties":11:{s:44:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'abstract_model";N;s:38:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'eav_rows";N;s:36:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'object";N;s:40:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'properties";N;s:48:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'property_key_to_id";a:0:{}s:53:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'property_id_to_group_id";a:0:{}s:43:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'static_values";N;s:51:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'table_inheritance_row";N;s:48:"' . "\0" . 'app\\properties\\HasProperties' . "\0" . 'propertiesFormName";N;s:5:"props";N;s:5:"owner";r:1;}i:1;r:59;i:2;r:92;i:3;r:66;i:4;r:99;}}'), ]; $_SESSION = [ '__flash' => [], ];