本文整理汇总了PHP中AppController::beforeFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::beforeFilter方法的具体用法?PHP AppController::beforeFilter怎么用?PHP AppController::beforeFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::beforeFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
$user = $this->Auth->user();
$this->Auth->allow('view');
$this->set('user', $user);
}
示例2: beforeFilter
/**
* Displays a view
*
* @param mixed What page to display
* @access public
*/
public function beforeFilter()
{
parent::beforeFilter();
if (isset($this->Auth)) {
$this->Auth->allow('display');
}
}
示例3: beforeFilter
function beforeFilter()
{
$this->Auth->allow('logout', 'reg', 'password_reset', 'view', 'acoset', 'aroset', 'permset', 'buildAcl');
parent::beforeFilter();
$this->Auth->autoRedirect = false;
//debug($this->Session->read() );
}
示例4: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
if ('json' == $this->params['url']['ext']) {
$this->RequestHandler->setContent('json', 'text/x-json');
}
}
示例5: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
if (!empty($this->Auth)) {
$this->Auth->allowedActions = array();
}
}
示例6: beforeFilter
public function beforeFilter()
{
$this->RequestHandler->respondAs('json');
$this->response->disableCache();
$this->Auth->allow(array('view'));
parent::beforeFilter();
}
示例7: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
//親(Appcontroller)をふまえた上
// ユーザー自身による登録とログアウトを許可する
$this->Auth->allow('add', 'logout');
}
示例8: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if (!empty($this->Auth)) {
$this->Auth->allow('display', 'ckeditor');
}
}
示例9: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
if (!empty($this->Auth)) {
$this->Auth->allowedActions = array('how_it_works', 'fetch_specific_content');
}
}
示例10: beforeFilter
/**
* beforeFilter
*
* @return oid
* @access public
*/
function beforeFilter()
{
parent::beforeFilter();
if ($this->params['prefix'] == 'admin') {
$this->set('usePermission', true);
}
}
示例11: beforeFilter
function beforeFilter()
{
$this->Auth->allow('index');
parent::beforeFilter();
$this->Auth->autoRedirect = false;
//debug($this->Session->read() );
}
示例12: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if (isset($this->Auth)) {
$this->Auth->allow('login', 'logout', 'setup');
}
}
示例13: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if (!isset($this->params['name'])) {
$this->error(ECode::$BOARD_NONE);
}
try {
$boardName = $this->params['name'];
if (preg_match("/^\\d+\$/", $boardName)) {
throw new BoardNullException();
}
$this->_board = Board::getInstance($boardName);
} catch (BoardNullException $e) {
$this->error(ECode::$BOARD_UNKNOW);
}
if (isset($this->params['url']['mode'])) {
$mode = (int) trim($this->params['url']['mode']);
if (!$this->_board->setMode($mode)) {
$this->error(ECode::$BOARD_NOPERM);
}
}
if (!$this->_board->hasReadPerm(User::getInstance())) {
if (!$this->ByrSession->isLogin) {
$this->requestLogin();
}
$this->error(ECode::$BOARD_NOPERM);
}
$this->_board->setOnBoard();
$this->ByrSession->Cookie->write("XWJOKE", "hoho", false);
}
示例14: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
if (Configure::read('Wildflower.htmlCache') and $this->params['action'] == 'view') {
$this->helpers[] = 'HtmlCache';
}
}
示例15: beforeFilter
function beforeFilter()
{
parent::beforeFilter();
Configure::write('debug', 0);
$this->layout = 'ajax';
$this->autoRender = false;
}