尝试在 CakePHP 2.0.0-dev 中设置移动主题,但它不像在 1.3 中那样工作。2.0 中的主题实现是否有任何变化?
结构如下:
app/views/themed/mobile/layouts/default.ctp
app/views/themed/mobile/pages/home.ctp
然后在 app/app_controller.php 中:
public function beforeRender()
{
if ($this->RequestHandler->isMobile()) {
$this->view = 'Theme';
$this->theme = 'mobile';
}
}
点击主页...但没有移动网站...只是普通网站。没有错误,调试或错误日志中没有任何内容。没有错误,没有例外。没有什么。好像主题已被弃用或其他什么。
有什么想法吗?