<?php
class BaseAction extends Action {
public function _initialize()
{
if(isset($_SESSION['USER_AUTH_KEY']) &&($_SESSION['USER_AUTH_KEY']!='')) {
$id=$_SESSION['USER_AUTH_KEY'];
$user=M('member');
$dao= $user->where("user_id='$id'")->find();
$this->assign('data',$dao);
$goodsCount = $this->GoodsCount();
$memberCount = $this->memberCount();
$storeCount = $this->storeCount();
$this->assign('goodsCount',$goodsCount);
$this->assign('memberCount',$memberCount);
$this->assign('storeCount',$storeCount);
}else {
//错误页面的默认跳转页面是返回前一页,通常不需要设置
$this->error('木有登录,请登录!','Login/Index');
}
}
?>现在遇到这个奇怪的问题。。页面木有跳转 _initialize 死循环一样执行。。。注我其他类继承自ba最佳答案