pictcode / app / Controller / AppController.php @ 0b1b8047
履歴 | 表示 | アノテート | ダウンロード (2.162 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 |
'home'
|
54 |
), |
55 |
'authenticate' => array( |
56 |
'Form' => array( |
57 |
'fields' => array( |
58 |
'username' => 'login_id', //Default is 'username' in the userModel |
59 |
'password' => 'password' //Default is 'password' in the userModel |
60 |
), |
61 |
'passwordHasher' => 'Blowfish' |
62 |
) |
63 |
), |
64 |
'flash' => array( |
65 |
'element' => 'alert', |
66 |
'key' => 'auth', |
67 |
'params' => array( |
68 |
'plugin' => 'BoostCake', |
69 |
'class' => 'alert-error' |
70 |
) |
71 |
) |
72 |
) |
73 |
); |
74 |
} |