CakePHP AJAX Layout

后端 未结 5 1115
清歌不尽
清歌不尽 2021-01-15 14:05

I\'m working with a CakePHP application and jQuery Mobile. In the CakePHP application, RequestHandler is turned on, now, jQuery Mobile makes all of it\'s requests as ajax re

5条回答
  •  忘掉有多难
    2021-01-15 14:39

    I was new to CakePHP and started with Version 2 several weeks ago.

    So far I also keep the beforeFilter untouched to identifier isMobile() and finally use mobile-views within a Themed-Folder. Therefore I dont use subfolders for mobile-views within the default desktop-views. After adding this->layout in the condition it seems that I got rid off the undefined which appeared only via some actions links.

    public function beforeRender() {
        if($this->RequestHandler->isMobile()) {
            $this->theme = 'Mobile';
            $this->layout = 'default';
        }
    }
    

提交回复
热议问题