代码之家  ›  专栏  ›  技术社区  ›  The.Anti.9

symfony$sf_参数未定义

  •  0
  • The.Anti.9  · 技术社区  · 14 年前

    我刚开始和symfony合作。我下载了sf_沙盒,但我在使用$sf_参数时遇到了问题。当我尝试对它使用任何方法时,例如 $sf_params->has('status')

    public function executeIndex() {
        if ($sf_params->has('status') && $sf_params->has('message')) {  // <--line 14
            if ($sf_params->get('status') == 'failed') {
                $this->message = $sf_params->get('message');
            }
        }
    }
    
    2 回复  |  直到 14 年前
        1
  •  5
  •   jgallant    14 年前

    public function executeIndex(sfWebRequest $request) {
        $request->getParameter("status");
        ...
    

        2
  •  3
  •   The.Anti.9    14 年前

    $sf_params