$pc_row = empty($pc_id) ? [] : \SharePool::fetchProductCateData($pc_id); //~20220209 允許產品無分類 $link = self::getProductDataLink($pc_row, $this->p_row, $is_seo); return $jsons; } //------------------------------------------------------------------------ //覆寫-1 //------------------------------------------------------------------------ protected function setRegularViewOptions($action, array $params) { parent::setRegularViewOptions($action, $params); $this->view->addCSS(\amg\FrontendView::CSS_PRODUCT); $this->view->addCSS(\amg\FrontendView::CSS_PRODUCT_DETAIL); $this->view->addJS(\amg\FrontendView::JS_PRODUCT_DETAIL); if($this->isLogined()) { $this->view->addJS(\amg\FrontendView::JS_MEMBER); //可能需要:加入追踨|放藏的功能
} $className = preg_replace_callback('%-([a-z0-9_])%i', function ($matches) { return ucfirst($matches[1]); }, ucfirst($className)) . 'Controller'; $className = ltrim($this->controllerNamespace . '\\' . str_replace('/', '\\', $prefix) . $className, '\\'); if (strpos($className, '-') !== false || !class_exists($className)) { return null; } if (is_subclass_of($className, 'yii\base\Controller')) { $controller = Yii::createObject($className, [$id, $this]); return get_class($controller) === $className ? $controller : null;
if (($pos = strrpos($route, '/')) !== false) { $id .= '/' . substr($route, 0, $pos); $route = substr($route, $pos + 1); } $controller = $this->createControllerByID($id); if ($controller === null && $route !== '') { $controller = $this->createControllerByID($id . '/' . $route); $route = ''; } return $controller === null ? false : [$controller, $route];
* @param array $params the parameters to be passed to the action * @return mixed the result of the action. * @throws InvalidRouteException if the requested route cannot be resolved into an action successfully. */ public function runAction($route, $params = []) { $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);
$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 PROGRAM_DIR.'/frontend/config/main.php', require PROGRAM_DIR.'/frontend/config/main-local.php' ); //---------------------------------------------------------------------------- (new \amg\AmgApplication($configs,false))->run(); //is-a \yii\web\Application
$_GET = [ 'sf1' => 'jap', 'sf2' => 'news-ndetail-2-2', ]; $_SESSION = [ '__flash' => [], ];