case "indexfilter12": case "indexfilter13": case "indexfilter14": case "indexfilter15": case "index": case "index1": case "index2": return "Categorie " . EquipmentCat::find() ->where(['id' => \yii::$app->getRequest()->getQueryParams()['id']]) ->one()->name; } } elseif ($controller->id == "equipment") { switch ($action->id) { case "view": case "view0": case "view1": case "view2": case "view3": return "Echipament " . Equipment::find()
case "indexfilter15": case "index": case "index1": case "index2": return "Categorie " . EquipmentCat::find() ->where(['id' => \yii::$app->getRequest()->getQueryParams()['id']]) ->one()->name; } } elseif ($controller->id == "equipment") { switch ($action->id) { case "view": case "view0": case "view1":
$log->ip = \app\models\Siteusers::getUserIP(); $log->date = date('Y-m-d H:i:s'); $log->browser = $_SERVER['HTTP_USER_AGENT']; $log->platform = 1; $log->link = \app\models\Siteusers::getUrl(); $log->operation = "Vizualizare " . \app\models\Siteusers::getLinktranslation(); //print_r(\yii::$app->getRequest()->getQueryParams()); //exit(); if (!\Yii::$app->user->isGuest) { $log->affectedsiteuser_id = \Yii::$app->user->identity->id; } //$log->save();
$event->sender = $this; } $event->handled = false; $event->name = $name; foreach ($this->_events[$name] as $handler) { $event->data = $handler[1]; call_user_func($handler[0], $event); // stop further handling if the event is handled if ($event->handled) { return; } } }
* @param Action $action the action to be executed. * @return boolean whether the action should continue to be executed. */ public function beforeAction($action) { $event = new ActionEvent($action); $this->trigger(self::EVENT_BEFORE_ACTION, $event); return $event->isValid; } /** * This method is invoked right after an action within this module is executed. *
$modules = []; $runAction = true; // call beforeAction on modules foreach ($this->getModules() as $module) { if ($module->beforeAction($action)) { array_unshift($modules, $module); } else { $runAction = false; break; } }
//exit(); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
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__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'name' => 'Echipamente Audio-Video - HDMI, VGA, CVBS', 'id' => '253', ];