0
class AppController extends Controller {
/**
* @var $IsAjax weather request is ajax or not
*/
public $RequestType = 'NORMAL'; //make this read only by child
function __construct()
{
if(isAjax())
$RequestType ='AJAX';
$layout = 'ajax'; //this var should not be editable further i.e read only by child
}
}
如果請求是ajax,我希望它不可編輯。如果失敗,$layout
應由兒童編輯。防止兒童根據條件編輯變量表
還有一種方法可以爲孩子製作變量readonly
。
那麼你的Ajax請求與「天氣」做什麼? :) – mark 2011-12-26 15:43:41