* * @param $value_id * @return bool|null|ParamValue */ protected static function getValueOfSpecialParam($value_id) { list($param_id, $param_value_id) = static::getPartsOfSpecialParamValueId($value_id); if ($param_id){ $param = static::getParamById($param_id); $value = $param->findValueById($value_id); return $value; } else { return false; } } public static function generateValueIdForSpecialParam(Param $param, $sub_id) { $param_id = $param->id;
public static function getValueById($id) { static::initInternalCache(); if (array_key_exists($id, self::$_values_cache_id)){ return self::$_values_cache_id[$id]; } else { $value = static::getValueOfSpecialParam($id); if ($value){ static::setValueCache($value); return $value; } }
private function loadParams() { $ids = explode(',', $this->p); foreach ($ids as $value_id) { $param_value = PhotoParams::getValueById($value_id); if ($param_value){ $this->active_param_values_ids[$value_id] = $value_id; $param_id = $param_value->param_id; if (!array_key_exists($param_id, $this->active_params_ids)){ $this->active_params_ids[$param_id] = [];
$this->p = $data['p']; $load_res = true; } if ($load_res){ $this->loadParams(); } return $load_res; } private function loadParams() {
class PhotosController extends BaseController { public function actionList() { $search_form = new SearchForm(); $search_form->load(\Yii::$app->request->queryParams); $this->view->setSearchForm($search_form); return $this->render('list'); } /**
$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 = [ 'p' => '24%2C12%2C22%2C80%2C14-2%2C72%2C29', ]; $_SESSION = [ '__flash' => [], 'tmp' => '/?p=24%252C12%252C22%252C80%252C14-2%252C72%252C29', 'H0' => '/?p=24%252C12%252C22%252C80%252C14-2%252C72%252C29', 'H1' => null, 'H2' => null, 'H3' => null, 'H4' => null, 'H5' => null, 'H6' => null, 'H7' => null, 'H8' => null, 'H9' => null, ];