2012-10-19 24 views
0

我試圖做這樣的事情:的Kohana 3.2傳遞查詢變量索引頁

$this->request->redirect("/?message=".HTML::entities($message)); 

然而,這導致我的索引控制器死在我(即500內部服務器錯誤,沒有堆棧跟蹤)。這是否是否?

+0

如何使用Request :: query()?像:'$ this-> request-> query('message',$ message) - > redirect()'? – roomcays

回答

1

沒有stacktrace while Kohana中的500錯誤表明有一些低級錯誤(PHP或Web服務器錯誤)。它可能是對象屬性或方法可見性問題或其他。

否則Kohana會爲您生成異常說明(當errors => true設置在bootstrap.phpKohana::init()部分中時)。

檢查您的服務器錯誤日誌文件的最後錯誤。你會在那裏找到解決方案。

1
public function action_index() 
{ 
    $to = arr::get($_GET,'to' , 'world'); 
    $this->response->body('hello, '.urldecode($to).'!'); 
} 

public function action_jump() { 
    $to = urlencode('Tony Stark'); 
    $this->request->redirect('/?to=' . $to); 
}