开发者

How to fix Zend session incorrect data ('css')

开发者 https://www.devze.com 2022-12-20 03:51 出处:网络
I have coded a simple admin module with ability to paginate records and sort them by some column. And when I sort and then call some other action on the records it should redirect the user back to ind

I have coded a simple admin module with ability to paginate records and sort them by some column. And when I sort and then call some other action on the records it should redirect the user back to index page with the same sort parameters as there were before. But after I call the indexAction() with parameters like this /admin/users/index/column/num_orders/order/ASC and then call the toggleActiveAction() I am redirected to page /admin/users/index/column/num_orders/order/CSS. The same story with .../index/page/2 => .../index/page/css.

Why "CSS"? My session data never used in other context than you see below.

In my bootstrap I have the following:

protected function _initSession()
{
    Zend_Session::start();
}

Controller init():

...
$this->_session = new Zend_Session_Namespace('Admin_Users');
...

I have a following function in my controller:

public function redirectToIndex()
{
    $options = array();
    if (isset($this->_session->curPage) && $this->_session->curPage != 1) 
        $options['page'] = $this->_session->curPage;
    if (isset($this->_session->curColumn) && $this->_session->curColumn) 
        $options['column'] = $this->_session->curColumn;
    if (isset($this->_session->curOrder) && $this->_session->curOrder) 
        $opt开发者_StackOverflow社区ions['order'] = $this->_session->curOrder;
    $this->_helper->redirector('index', 'users', 'admin', $options);
}

In index action:

$curColumn = $this->_getParam('column', '');
$curOrder = strtoupper($this->_getParam('order', ''));
$page = $this->_getParam('page', 1);
...
$this->_session->curPage = $page;
$this->_session->curColumn = $curColumn;
$this->_session->curOrder = $curOrder;

Then in toggleActiveAction() I call

$this->redirectToIndex();


I guess there is a unexisted css file on your page (on js or img) which is handled with Zend Framewok froncontroller. Youd should enable log for all requests that are handled with ZF and you will find there a request like "/theme/supersite/css/thisFileNotExists.css" (or similar :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号