Copied! Copy Stacktrace Search Stackoverflow Search Google Error

PHP Notice千赢国际娱乐网站_千赢国际娱乐首页_千赢国际登陆

Undefined index: category_id

  • 1. in /web/www/www.ybcjtjt.com/frontend/controllers/ListController.php at line 21
    12131415161718192021222324252627282930
                         
    class ListController extends \yii\web\Controller
    {
        /**
         * 文章列表
         */
        public function actionIndex()
        {
            $posts = Yii::$app->request->get();
            $categoryId = $posts['category_id'];
            $view = [];
     
            $view['breadcrumb'] = [
                'activeItemTemplate' => "<li class=\"uk-active\">{link}</li>\n",
                'homeLink' => [
                    'label' => '首页',
                    'url' => ['/'],
                    //'template' => "<li><b>{link}</b></li>\n",
                ],
                    
  • 2. in /web/www/www.ybcjtjt.com/frontend/controllers/ListController.php at line 21 yii\base\ErrorHandler::handleError(8, 'Undefined index: category_id', '/web/www/www.ybcjtjt.com/fronten...', 21, ...)
    15161718192021222324252627
                            /**
         * 文章列表
         */
        public function actionIndex()
        {
            $posts = Yii::$app->request->get();
            $categoryId = $posts['category_id'];
            $view = [];
     
            $view['breadcrumb'] = [
                'activeItemTemplate' => "<li class=\"uk-active\">{link}</li>\n",
                'homeLink' => [
                    'label' => '首页',
                    
  • 3. frontend\controllers\ListController::actionIndex()
  • 4. in /web/www/www.ybcjtjt.com/vendor/yiisoft/yii2/base/InlineAction.php at line 57 – call_user_func_array([frontend\controllers\ListController, 'actionIndex'], [])
    515253545556575859
                                $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);
        }
    }
                    
  • 5. in /web/www/www.ybcjtjt.com/vendor/yiisoft/yii2/base/Controller.php at line 157 yii\base\InlineAction::runWithParams(['r' => 'list', 'amp;category_id' => '14'])
    151152153154155156157158159160161162163
                                }
     
            $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 */
                    
  • 6. in /web/www/www.ybcjtjt.com/vendor/yiisoft/yii2/base/Module.php at line 528 yii\base\Controller::runAction('', ['r' => 'list', 'amp;category_id' => '14'])
    522523524525526527528529530531532533534
                                $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;
            }
                    
  • 7. in /web/www/www.ybcjtjt.com/vendor/yiisoft/yii2/web/Application.php at line 103 yii\base\Module::runAction('list', ['r' => 'list', 'amp;category_id' => '14'])
    979899100101102103104105106107108109
                                    $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) {
                    
  • 8. in /web/www/www.ybcjtjt.com/vendor/yiisoft/yii2/base/Application.php at line 386 yii\web\Application::handleRequest(yii\web\Request)
    380381382383384385386387388389390391392
                            {
            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();
                    
  • 9. in /web/www/www.ybcjtjt.com/frontend/web/index.php at line 17 yii\base\Application::run()
    11121314151617
                            require __DIR__ . '/../../common/config/main.php',
        require __DIR__ . '/../../common/config/main-local.php',
        require __DIR__ . '/../config/main.php',
        require __DIR__ . '/../config/main-local.php'
    );
     
    (new yii\web\Application($config))->run();
                    
  • $_GET = [
        'r' => 'list',
        'amp;category_id' => '14',
    ];