* @param \app\models\UrunKategori $kategori * @return array */ private function bagliKategoriler($kategori) { $kat_ids = array(); $altKategoriler = $kategori->altKategoriler; foreach($altKategoriler as $altKategori){ $kat_ids[] = $altKategori->urun_kategori_id; $kat_ids = array_merge($kat_ids, $this->bagliKategoriler($altKategori)); } return $kat_ids; } public function actionDetay()
private function bagliKategoriler($kategori) { $kat_ids = array(); $altKategoriler = $kategori->altKategoriler; foreach($altKategoriler as $altKategori){ $kat_ids[] = $altKategori->urun_kategori_id; $kat_ids = array_merge($kat_ids, $this->bagliKategoriler($altKategori)); } return $kat_ids;
->andWhere('dil = :dil', [':dil' => Yii::$app->language]) ->one(); }, 3600 * 24); $kats = array(); $kats[] = $kat_db->urun_kategori_id; $kats = array_merge($kats, $this->bagliKategoriler($kat_db->urunKategori)); $sorgu->andWhere(['urun.urun_kategori_id' => $kats]); } $sorgu->orderBy('urun_icerik.urun_id DESC');
$args = $this->controller->bindActionParams($this, $params); Yii::trace('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); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$route = $this->catchAll[0]; $params = array_splice($this->catchAll, 1); } 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__ . '/../yii/vendor/autoload.php'); require(__DIR__ . '/../yii/vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../yii/config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'kategori' => 'software', ]; $_SERVER = [ 'PATH' => '/usr/local/bin:/bin:/usr/bin', 'HTTP_ACCEPT' => '*/*', 'HTTP_HOST' => 'onalsoftware.com', 'HTTP_USER_AGENT' => 'claudebot', 'DOCUMENT_ROOT' => '/home/onalsmwu/public_html', 'REMOTE_ADDR' => '54.160.133.33', 'REMOTE_PORT' => '34408', 'SERVER_ADDR' => '45.158.12.111', 'SERVER_NAME' => 'onalsoftware.com', 'SERVER_ADMIN' => 'webmaster@onalsoftware.com', 'SERVER_PORT' => '80', 'REQUEST_SCHEME' => 'http', 'REQUEST_URI' => '/urunler/software', 'REDIRECT_URL' => '/urunler/software', 'REDIRECT_REQUEST_METHOD' => 'GET', 'REDIRECT_STATUS' => '200', 'SCRIPT_FILENAME' => '/home/onalsmwu/public_html/index.php', 'QUERY_STRING' => '', 'SCRIPT_URI' => 'http://onalsoftware.com/urunler/software', 'SCRIPT_URL' => '/urunler/software', 'SCRIPT_NAME' => '/index.php', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SOFTWARE' => 'LiteSpeed', 'REQUEST_METHOD' => 'GET', 'X-LSCACHE' => 'on', 'PHP_SELF' => '/index.php', 'REQUEST_TIME_FLOAT' => 1711631885.65779399871826171875, 'REQUEST_TIME' => 1711631885, 'argv' => [], 'argc' => 0, ];