// Add complex scheme if exist //if ($building['scheme_image']) // $building['images'][] = $building['scheme_image']; // cache images if ($building['developer_logo']) $building['developer_logo'] = Yii::$app->imgEngine->cache($building['developer_logo'], 'developer-logo', 'developers'); foreach ($building['images'] as $index => $image) { $cachedImages[] = [ 'medium' => Yii::$app->imgEngine->cache($image, 'complex-medium', 'complex'), 'thumb' => Yii::$app->imgEngine->cache($image, 'complex-thumb', 'complex'), 'original' => Yii::$app->imgEngine->cache($image, 'complex-full', 'complex'), ]; } $building['images'] = $cachedImages ?? []; $building['comments'] = self::getComments([
// cache images if ($building['developer_logo']) $building['developer_logo'] = Yii::$app->imgEngine->cache($building['developer_logo'], 'developer-logo', 'developers'); foreach ($building['images'] as $index => $image) { $cachedImages[] = [ 'medium' => Yii::$app->imgEngine->cache($image, 'complex-medium', 'complex'), 'thumb' => Yii::$app->imgEngine->cache($image, 'complex-thumb', 'complex'), 'original' => Yii::$app->imgEngine->cache($image, 'complex-full', 'complex'), ]; }
$slug = $data->getSlug(); $sectionId = $params['section'] ?? 5; // If url contain id show object page if (isset($params['building'])) { $object = nRealty::getBuilding($params['building'], $sectionId, true); if (!$object) throw new NotFoundHttpException('Объект не найден'); $object['photoreports'] = array_map(function($item, $key) use ($params) { $postfix = ($key) ? '-small' : '';
$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();
); define('DB_RS', 'realty_secondary'); define('DB_RN', 'realty_new'); define('LOGO_OVERLAY_FILE', '/home/hachari/m2.center/inpars/img/logo.png'); (new yii\web\Application($config))->run();
$_GET = [ 'building' => 'zhk_rezidencziya', 'r' => 'vse_zhk/zhk_rezidencziya', ];