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();
$img = app\modules\image\widgets\ImageOptimizeWidget::widget([ 'src' => $agregator->hasImage() ? '/files/'.$agregator->getImage()->filename : null, 'emptyImage' => '/theme/2018/distr/img/doc-alternate-002-459x459.png', 'width' => 458, 'height' => 458, 'alt' => implode(' ', ['Врач', $agregator->getDoctor()->name]) ]); $positiveReviews = 0; $negativeReviews = 0;
{ $_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
'referer' => Yii::$app->getRequest()->getReferrer(), 'agregator' => $agregator, 'related' => $relatedList->execute(['image', 'clinics', 'categories']), 'mapPoints' => Json::encode($mapPoints ? $mapPoints : []), 'rating_sum'=> $rating_sum, 'stocks' => $stocks, 'title_h1' => $title_h1 ]); } public function actionShowAjax($category = null, $district = null){ $category = Category::findBySlug($category, 0);
$isAjax = Yii::$app->getRequest()->isAjax; if(is_numeric($product)){ throw new NotFoundHttpException(); } if(is_object($product)){ return $this->show($product); }else if($isAjax){ return $this->ajaxList($category, $district); }else{ return $this->list($category, $district); }
$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' => null, 'parent_id' => 1, 'object_id' => 15, 'product' => unserialize('O:37:"app\\modules\\shop\\models\\OfflineDoctor":15:{s:15:"' . "\0" . '*' . "\0" . 'category_ids";N;s:20:"relatedProductsArray";a:0:{}s:10:"categories";N;s:54:"' . "\0" . 'app\\modules\\shop\\models\\Product' . "\0" . 'activeWarehousesState";N;s:7:"rank_cd";N;s:36:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_attributes";a:32:{s:2:"id";i:2252;s:16:"main_category_id";i:1;s:9:"parent_id";i:0;s:15:"option_generate";s:0:"";s:4:"name";s:48:"Галиев Шамиль Зульфарович";s:5:"title";s:48:"Галиев Шамиль Зульфарович";s:2:"h1";s:48:"Галиев Шамиль Зульфарович";s:16:"meta_description";s:48:"Галиев Шамиль Зульфарович";s:17:"breadcrumbs_label";s:48:"Галиев Шамиль Зульфарович";s:4:"slug";s:36:"galiev-shamil-zulfarovich-ldc-173749";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:1:".";s:8:"announce";N;s:10:"sort_order";i:0;s:6:"active";i:1;s:5:"price";d:0;s:9:"old_price";d:0;s:3:"sku";s:0:"";s:15:"unlimited_count";i:1;s:11:"currency_id";i:1;s:10:"measure_id";i:1;s:10:"date_added";s:19:"2020-01-27 16:57:59";s:13:"date_modified";s:19:"2021-01-11 15:50:23";s:12:"is_medclinic";b:0;s:13:"owner_user_id";i:696;s:19:"parent_medclinic_id";i:0;s:3:"fts";s:55:"\'гал\':1A \'зульфарович\':3A \'шамил\':2A";s:5:"snils";N;s:14:"properties_dop";s:23:"{"no_best_doctor": "1"}";s:8:"seo_text";s:0:"";s:8:"priority";N;}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:32:{s:2:"id";i:2252;s:16:"main_category_id";i:1;s:9:"parent_id";i:0;s:15:"option_generate";s:0:"";s:4:"name";s:48:"Галиев Шамиль Зульфарович";s:5:"title";s:48:"Галиев Шамиль Зульфарович";s:2:"h1";s:48:"Галиев Шамиль Зульфарович";s:16:"meta_description";s:48:"Галиев Шамиль Зульфарович";s:17:"breadcrumbs_label";s:48:"Галиев Шамиль Зульфарович";s:4:"slug";s:36:"galiev-shamil-zulfarovich-ldc-173749";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:1:".";s:8:"announce";N;s:10:"sort_order";i:0;s:6:"active";i:1;s:5:"price";d:0;s:9:"old_price";d:0;s:3:"sku";s:0:"";s:15:"unlimited_count";i:1;s:11:"currency_id";i:1;s:10:"measure_id";i:1;s:10:"date_added";s:19:"2020-01-27 16:57:59";s:13:"date_modified";s:19:"2021-01-11 15:50:23";s:12:"is_medclinic";b:0;s:13:"owner_user_id";i:696;s:19:"parent_medclinic_id";i:0;s:3:"fts";s:55:"\'гал\':1A \'зульфарович\':3A \'шамил\':2A";s:5:"snils";N;s:14:"properties_dop";s:23:"{"no_best_doctor": "1"}";s:8:"seo_text";s:0:"";s:8:"priority";N;}s:33:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_related";a:2:{s:6:"images";a:0:{}s:14:"doctorCategory";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:83;s:17:"category_group_id";i:1;s:9:"parent_id";i:1;s:4:"name";s:22:"Эндоскопист";s:5:"title";s:22:"Эндоскопист";s:2:"h1";s:22:"Эндоскопист";s:16:"meta_description";s:269:"Сервис ОК\'Доктор предлагает записаться на прием к эндоскописту по самым выгодным ценам. Прием платного эндоскописту в самое удобное для вас время.";s:17:"breadcrumbs_label";s:22:"Эндоскопист";s:4:"slug";s:11:"endoskopist";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:719:"<p>Сервис<img src="/upload/images/58eb3adf2b624.png" height="15" alt="записаться на прием к эндоскописту" style="height: 15px;"> - это удобный способ быстро записаться на прием к эндоскописту в платную клиинку. Мы предлагаем доступ к самым лучшим взрослым и детским эндоскопистам в Казани, который мы формируем на основании отзывов. <br> </p> <p>Записаться на прием к эндоскописту вместе с ОК\'Доктор - это действительно удобно!<br><br><br> </p>";s:8:"announce";s:0:"";s:10:"sort_order";i:2700;s:12:"title_append";s:83:"- записаться на прием к платному эндоскописту";s:6:"active";i:1;s:10:"date_added";s:19:"2017-02-15 14:32:37";s:13:"date_modified";s:19:"2017-06-28 15:51:08";s:11:"property_id";i:0;s:17:"property_group_id";i:0;s:3:"fts";s:31:"\'1\' \'эндоскопист\':1A";}s:39:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_oldAttributes";a:21:{s:2:"id";i:83;s:17:"category_group_id";i:1;s:9:"parent_id";i:1;s:4:"name";s:22:"Эндоскопист";s:5:"title";s:22:"Эндоскопист";s:2:"h1";s:22:"Эндоскопист";s:16:"meta_description";s:269:"Сервис ОК\'Доктор предлагает записаться на прием к эндоскописту по самым выгодным ценам. Прием платного эндоскописту в самое удобное для вас время.";s:17:"breadcrumbs_label";s:22:"Эндоскопист";s:4:"slug";s:11:"endoskopist";s:13:"slug_compiled";s:0:"";s:13:"slug_absolute";i:0;s:7:"content";s:719:"<p>Сервис<img src="/upload/images/58eb3adf2b624.png" height="15" alt="записаться на прием к эндоскописту" style="height: 15px;"> - это удобный способ быстро записаться на прием к эндоскописту в платную клиинку. Мы предлагаем доступ к самым лучшим взрослым и детским эндоскопистам в Казани, который мы формируем на основании отзывов. <br> </p> <p>Записаться на прием к эндоскописту вместе с ОК\'Доктор - это действительно удобно!<br><br><br> </p>";s:8:"announce";s:0:"";s:10:"sort_order";i:2700;s:12:"title_append";s:83:"- записаться на прием к платному эндоскописту";s:6:"active";i:1;s:10:"date_added";s:19:"2017-02-15 14:32:37";s:13:"date_modified";s:19:"2017-06-28 15:51:08";s:11:"property_id";i:0;s:17:"property_group_id";i:0;s:3:"fts";s:31:"\'1\' \'эндоскопист\':1A";}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:75;}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:75;}i:1;s:11:"afterDelete";}i:1;N;}}s:11:"afterInsert";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:133;i:1;s:14:"invalidateTags";}i:1;N;}}s:11:"afterUpdate";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:133;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:75;}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:75;}i:1;s:18:"evaluateAttributes";}i:1;N;}}s:12:"beforeUpdate";a:1:{i:0;a:2:{i:0;a:2:{i:0;r:173;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:75;}i:1;r:133;i:2;r:166;i:3;r:140;i:4;r:173;}}}s:47:"' . "\0" . 'yii\\db\\BaseActiveRecord' . "\0" . '_relationsDependencies";a:1:{s:2:"id";a:2:{s:6:"images";s:6:"images";s:14:"doctorCategory";s:14:"doctorCategory";}}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:3:{i:0;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;}i:1;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:2;a:2:{i:0;a:2:{i:0;O:37:"nhkey\\arh\\ActiveRecordHistoryBehavior":5:{s:7:"manager";s:28:"nhkey\\arh\\managers\\DBManager";s:12:"ignoreFields";a:2:{i:0;s:10:"date_added";i:1;s:13:"date_modified";}s:10:"eventsList";a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}s:14:"managerOptions";N;s:5:"owner";r:1;}i:1;s:11:"saveHistory";}i:1;N;}}s:11:"afterInsert";a:2:{i:0;a:2:{i:0;a:2:{i:0;r:237;i:1;s:14:"invalidateTags";}i:1;N;}i:1;a:2:{i:0;a:2:{i:0;r:244;i:1;s:11:"saveHistory";}i:1;N;}}s:11:"afterUpdate";a:2:{i:0;a:2:{i:0;a:2:{i:0;r:237;i:1;s:14:"invalidateTags";}i:1;N;}i:1;a:2:{i:0;a:2:{i:0;r:244;i:1;s:11:"saveHistory";}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:290;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:6:{i:0;r:224;i:1;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:2;r:237;i:3;r:283;i:4;r:290;s:7:"history";r:244;}}'), ]; $_SESSION = [ '__flash' => [], ];