OSDN Git Service

version number to 2.6.0beta2
[ethna/ethna.git] / skel / app.controller.php
1 <?php
2 /**
3  *  {$project_id}_Controller.php
4  *
5  *  @author     {$author}
6  *  @package    {$project_id}
7  *  @version    $Id$
8  */
9
10 /** Application base directory */
11 define('BASE', dirname(dirname(__FILE__)));
12
13 /** include_path setting (adding "/app" and "/lib" directory to include_path) */
14 $app = BASE . "/app";
15 $lib = BASE . "/lib";
16 set_include_path(implode(PATH_SEPARATOR, array($app, $lib)) . PATH_SEPARATOR . get_include_path());
17
18
19 /** including application library. */
20 require_once 'Ethna/Ethna.php';
21 require_once '{$project_id}_Error.php';
22 require_once '{$project_id}_ActionClass.php';
23 require_once '{$project_id}_ActionForm.php';
24 require_once '{$project_id}_ViewClass.php';
25
26 /**
27  *  {$project_id} application Controller definition.
28  *
29  *  @author     {$author}
30  *  @access     public
31  *  @package    {$project_id}
32  */
33 class {$project_id}_Controller extends Ethna_Controller
34 {
35     /**#@+
36      *  @access private
37      */
38
39     /**
40      *  @var    string  Application ID(appid)
41      */
42     var $appid = '{$application_id}';
43
44     /**
45      *  @var    array   forward definition.
46      */
47     var $forward = array(
48         /*
49          *  TODO: write forward definition here.
50          *
51          *  Example:
52          *
53          *  'index'         => array(
54          *      'view_name' => '{$project_id}_View_Index',
55          *  ),
56          */
57     );
58
59     /**
60      *  @var    array   action definition.
61      */
62     var $action = array(
63         /*
64          *  TODO: write action definition here.
65          *
66          *  Example:
67          *
68          *  'index'     => array(
69          *      'form_name' => 'Sample_Form_SomeAction',
70          *      'form_path' => 'Some/Action.php',
71          *      'class_name' => 'Sample_Action_SomeAction',
72          *      'class_path' => 'Some/Action.php',
73          *  ),
74          */
75     );
76
77     /**
78      *  @var    array   SOAP action definition.
79      */
80     var $soap_action = array(
81         /*
82          *  TODO: write action definition for SOAP application here.
83          *  Example:
84          *
85          *  'sample'            => array(),
86          */
87     );
88
89     /**
90      *  @var    array       application directory.
91      */
92     var $directory = array(
93         'action'        => 'app/action',
94         'action_cli'    => 'app/action_cli',
95         'action_xmlrpc' => 'app/action_xmlrpc',
96         'app'           => 'app',
97         'plugin'        => 'app/plugin',
98         'bin'           => 'bin',
99         'etc'           => 'etc',
100         'filter'        => 'app/filter',
101         'locale'        => 'locale',
102         'log'           => 'log',
103         'plugins'       => array('app/plugin/Smarty', 'lib/Ethna/extlib/Plugin/Smarty'),
104         'template'      => 'template',
105         'template_c'    => 'tmp',
106         'tmp'           => 'tmp',
107         'view'          => 'app/view',
108         'www'           => 'www',
109         'test'          => 'app/test',
110     );
111
112     /**
113      *  @var    array       database access definition.
114      */
115     var $db = array(
116         ''              => DB_TYPE_RW,
117     );
118
119     /**
120      *  @var    array       extention(.php, etc) configuration.
121      */
122     var $ext = array(
123         'php'           => 'php',
124         'tpl'           => 'tpl',
125     );
126
127     /**
128      *  @var    array   class definition.
129      */
130     var $class = array(
131         /*
132          *  TODO: When you override Configuration class, Logger class,
133          *        SQL class, don't forget to change definition as follows!
134          */
135         'class'         => 'Ethna_ClassFactory',
136         'backend'       => 'Ethna_Backend',
137         'config'        => 'Ethna_Config',
138         'db'            => 'Ethna_DB_PEAR',
139         'error'         => 'Ethna_ActionError',
140         'form'          => '{$project_id}_ActionForm',
141         'i18n'          => 'Ethna_I18N',
142         'logger'        => 'Ethna_Logger',
143         'plugin'        => 'Ethna_Plugin',
144         'session'       => 'Ethna_Session',
145         'sql'           => 'Ethna_AppSQL',
146         'view'          => '{$project_id}_ViewClass',
147         'renderer'      => 'Ethna_Renderer_Smarty',
148         'url_handler'   => '{$project_id}_UrlHandler',
149     );
150
151     /**
152      *  @var    array       filter definition.
153      */
154     var $filter = array(
155         /*
156          *  TODO: when you use filter, write filter plugin name here.
157          *  (If you specify class name, Ethna reads filter class in 
158          *   filter directory)
159          *
160          *  Example:
161          *
162          *  'ExecutionTime',
163          */
164     );
165
166     /**#@-*/
167
168     /**
169      *  Get Default language and locale setting.
170      *  If you want to change Ethna's output encoding, override this method.
171      *
172      *  @access protected
173      *  @return array   locale name(e.x ja_JP, en_US .etc),
174      *                  system encoding name,
175      *                  client encoding name(= template encoding)
176      *                  (locale name is "ll_cc" format. ll = language code. cc = country code.)
177      */
178     function _getDefaultLanguage()
179     {
180         return array('{$locale}', 'UTF-8', '{$client_enc}');
181     }
182
183     /**
184      *  テンプレートエンジンのデフォルト状態を設定する
185      *
186      *  @access protected
187      *  @param  object  Ethna_Renderer  レンダラオブジェクト
188      *  @obsolete
189      */
190     function _setDefaultTemplateEngine(&$renderer)
191     {
192     }
193 }
194