OSDN Git Service

Merge branch 'session_handler_configure'
[ethna/ethna.git] / skel / app.action.default.php
1 <?php
2 /**
3  *  Index.php
4  *
5  *  @author    {$author}
6  *  @package   {$project_id}
7  *  @version   $Id$
8  */
9
10 /**
11  *  Index form implementation
12  *
13  *  @author    {$author}
14  *  @access    public
15  *  @package   {$project_id}
16  */
17
18 class {$project_id}_Form_Index extends {$project_id}_ActionForm
19 {
20     /**
21      *  @access   private
22      *  @var      array   form definition.
23      */
24     var $form = array(
25        /*
26         *  TODO: Write form definition which this action uses.
27         *  @see http://ethna.jp/ethna-document-dev_guide-form.html
28         *
29         *  Example(You can omit all elements except for "type" one) :
30         *
31         *  'sample' => array(
32         *      // Form definition
33         *      'type'        => VAR_TYPE_INT,    // Input type
34         *      'form_type'   => FORM_TYPE_TEXT,  // Form type
35         *      'name'        => 'Sample',        // Display name
36         *  
37         *      //  Validator (executes Validator by written order.)
38         *      'required'    => true,            // Required Option(true/false)
39         *      'min'         => null,            // Minimum value
40         *      'max'         => null,            // Maximum value
41         *      'regexp'      => null,            // String by Regexp
42         *      'mbregexp'    => null,            // Multibype string by Regexp
43         *      'mbregexp_encoding' => 'UTF-8',   // Matching encoding when using mbregexp 
44         *
45         *      //  Filter
46         *      'filter'      => 'sample',        // Optional Input filter to convert input
47         *      'custom'      => null,            // Optional method name which
48         *                                        // is defined in this(parent) class.
49         *  ),
50         */
51     );
52
53     /**
54      *  Form input value convert filter : sample
55      *
56      *  @access protected
57      *  @param  mixed   $value  Form Input Value
58      *  @return mixed           Converted result.
59      */
60     /*
61     function _filter_sample($value)
62     {
63         //  convert to upper case.
64         return strtoupper($value);
65     }
66     */
67 }
68
69 /**
70  *  Index action implementation.
71  *
72  *  @author     {$author}
73  *  @access     public
74  *  @package    {$project_id}
75  */
76 class {$project_id}_Action_Index extends {$project_id}_ActionClass
77 {
78     /**
79      *  preprocess Index action.
80      *
81      *  @access    public
82      *  @return    string  Forward name (null if no errors.)
83      */
84     function prepare()
85     {
86         /**
87         if ($this->af->validate() > 0) {
88             return 'error';
89         }
90         $sample = $this->af->get('sample');
91         */
92         return null;
93     }
94
95     /**
96      *  Index action implementation.
97      *
98      *  @access    public
99      *  @return    string  Forward Name.
100      */
101     function perform()
102     {
103         return 'index';
104     }
105 }
106