pictcode / app / Controller / AppController.php @ 93b01961
履歴 | 表示 | アノテート | ダウンロード (2.14 KB)
1 |
<?php
|
---|---|
2 |
/**
|
3 |
* Application level Controller
|
4 |
*
|
5 |
* This file is application-wide controller file. You can put all
|
6 |
* application-wide controller-related methods here.
|
7 |
*
|
8 |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
9 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
10 |
*
|
11 |
* Licensed under The MIT License
|
12 |
* For full copyright and license information, please see the LICENSE.txt
|
13 |
* Redistributions of files must retain the above copyright notice.
|
14 |
*
|
15 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
|
16 |
* @link http://cakephp.org CakePHP(tm) Project
|
17 |
* @package app.Controller
|
18 |
* @since CakePHP(tm) v 0.2.9
|
19 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
20 |
*/
|
21 |
|
22 |
App::uses('Controller', 'Controller'); |
23 |
|
24 |
/**
|
25 |
* Application Controller
|
26 |
*
|
27 |
* Add your application-wide methods in the class below, your controllers
|
28 |
* will inherit them.
|
29 |
*
|
30 |
* @package app.Controller
|
31 |
* @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
|
32 |
*/
|
33 |
class AppController extends Controller { |
34 |
public $helpers = array( |
35 |
'Session',
|
36 |
'Html' => array('className' => 'BoostCake.BoostCakeHtml'), |
37 |
'Form' => array('className' => 'BoostCake.BoostCakeForm'), |
38 |
'Paginator' => array('className' => 'BoostCake.BoostCakePaginator'), |
39 |
); |
40 |
|
41 |
public $components = array( |
42 |
'DebugKit.Toolbar',
|
43 |
'Session',
|
44 |
'Flash',
|
45 |
'Auth' => array( |
46 |
'loginRedirect' => array( |
47 |
'controller' => 'users', |
48 |
'action' => 'index' |
49 |
), |
50 |
'logoutRedirect' => array( |
51 |
'controller' => 'users', |
52 |
'action' => 'login', |
53 |
), |
54 |
'authenticate' => array( |
55 |
'Form' => array( |
56 |
'fields' => array( |
57 |
'username' => 'login_id', //Default is 'username' in the userModel |
58 |
'password' => 'password' //Default is 'password' in the userModel |
59 |
), |
60 |
'passwordHasher' => 'Blowfish' |
61 |
) |
62 |
), |
63 |
'flash' => array( |
64 |
'element' => 'alert', |
65 |
'key' => 'auth', |
66 |
'params' => array( |
67 |
'plugin' => 'BoostCake', |
68 |
'class' => 'alert-error' |
69 |
) |
70 |
) |
71 |
) |
72 |
); |
73 |
} |