|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
// +---------------------------------------------------------------------------+ |
|
4
|
|
|
// | This file is part of the Agavi package. | |
|
5
|
|
|
// | Copyright (c) 2005-2011 the Agavi Project. | |
|
6
|
|
|
// | | |
|
7
|
|
|
// | For the full copyright and license information, please view the LICENSE | |
|
8
|
|
|
// | file that was distributed with this source code. You can also view the | |
|
9
|
|
|
// | LICENSE file online at http://www.agavi.org/LICENSE.txt | |
|
10
|
|
|
// | vi: set noexpandtab: | |
|
11
|
|
|
// | Local Variables: | |
|
12
|
|
|
// | indent-tabs-mode: t | |
|
13
|
|
|
// | End: | |
|
14
|
|
|
// +---------------------------------------------------------------------------+ |
|
15
|
|
|
|
|
16
|
|
|
class Default_ModuleDisabledAction extends SampleAppDefaultBaseAction |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* This Action does not yet serve any Request methods. |
|
20
|
|
|
* When a request comes in and this Action is used, execution will be skipped |
|
21
|
|
|
* and the View returned by getDefaultViewName() will be used. |
|
22
|
|
|
* |
|
23
|
|
|
* If an Action has an execute() method, this means it serves all methods. |
|
24
|
|
|
* Alternatively, you can implement executeRead() and executeWrite() methods, |
|
25
|
|
|
* because "read" and "write" are the default names for Web Request methods. |
|
26
|
|
|
* Other request methods may be explicitely served via execcuteReqmethname(). |
|
27
|
|
|
* |
|
28
|
|
|
* Keep in mind that if an Action serves a Request method, validation will be |
|
29
|
|
|
* performed prior to execution. |
|
30
|
|
|
* |
|
31
|
|
|
* Usually, for example for an AddProduct form, your Action should only be run |
|
32
|
|
|
* when a POST request comes in, which is mapped to the "write" method by |
|
33
|
|
|
* default. Therefor, you'd only implement executeWrite() and put the logic to |
|
34
|
|
|
* add the new product to the database there, while for GET (o.e. "read") |
|
35
|
|
|
* requests, execution would be skipped, and the View name would be determined |
|
36
|
|
|
* using getDefaultViewName(). |
|
37
|
|
|
* |
|
38
|
|
|
* We strongly recommend to prefer specific executeWhatever() methods over the |
|
39
|
|
|
* "catchall" execute(). |
|
40
|
|
|
* |
|
41
|
|
|
* Besides execute() and execute*(), there are other methods that might either |
|
42
|
|
|
* be generic or specific to a request method. These are: |
|
43
|
|
|
* registerValidators() and register*Validators() |
|
44
|
|
|
* validate() and validate*() |
|
45
|
|
|
* handleError() and handle*Error() |
|
46
|
|
|
* |
|
47
|
|
|
* The execution of these methods is not dependent on the respective specific |
|
48
|
|
|
* execute*() being present, e.g. for a "write" Request, validateWrite() will |
|
49
|
|
|
* be run even if there is no executeWrite() method. |
|
50
|
|
|
*/ |
|
51
|
|
|
// public function execute(AgaviRequestDataHolder $rd) |
|
52
|
|
|
// { |
|
53
|
|
|
// return 'Success'; |
|
54
|
|
|
// } |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* This method returns the View name in case the Action doesn't serve the |
|
58
|
|
|
* current Request method. |
|
59
|
|
|
* |
|
60
|
|
|
* !!!!!!!!!! DO NOT PUT ANY LOGIC INTO THIS METHOD !!!!!!!!!! |
|
61
|
|
|
* |
|
62
|
|
|
* @return mixed - A string containing the view name associated with this |
|
63
|
|
|
* action, or... |
|
64
|
|
|
* - An array with two indices: |
|
65
|
|
|
* 0. The parent module of the view that will be executed. |
|
66
|
|
|
* 1. The view that will be executed. |
|
67
|
|
|
* |
|
68
|
|
|
*/ |
|
69
|
|
|
public function getDefaultViewName() |
|
70
|
|
|
{ |
|
71
|
|
|
return 'Success'; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
?> |