1 | <?php |
||
9 | class CFormExample extends \Mos\HTMLForm\CForm |
||
10 | { |
||
11 | use \Anax\DI\TInjectionAware, |
||
12 | \Anax\MVC\TRedirectHelpers; |
||
13 | |||
14 | |||
15 | |||
16 | /** |
||
17 | * Constructor |
||
18 | * |
||
19 | */ |
||
20 | public function __construct() |
||
49 | |||
50 | |||
51 | |||
52 | /** |
||
53 | * Customise the check() method. |
||
54 | * |
||
55 | * @param callable $callIfSuccess handler to call if function returns true. |
||
56 | * @param callable $callIfFail handler to call if function returns true. |
||
57 | */ |
||
58 | public function check($callIfSuccess = null, $callIfFail = null) |
||
62 | |||
63 | |||
64 | |||
65 | /** |
||
66 | * Callback for submit-button. |
||
67 | * |
||
68 | */ |
||
69 | public function callbackSubmit() |
||
70 | { |
||
71 | $this->AddOutput("<p>DoSubmit(): Form was submitted.<p>"); |
||
72 | $this->AddOutput("<p>Do stuff (save to database) and return true (success) or false (failed processing)</p>"); |
||
73 | $this->AddOutput("<p><b>Name: " . $this->Value('name') . "</b></p>"); |
||
74 | $this->AddOutput("<p><b>Email: " . $this->Value('email') . "</b></p>"); |
||
75 | $this->AddOutput("<p><b>Phone: " . $this->Value('phone') . "</b></p>"); |
||
76 | $this->saveInSession = true; |
||
|
|||
77 | return true; |
||
78 | } |
||
79 | |||
80 | |||
81 | |||
82 | /** |
||
83 | * Callback for submit-button. |
||
84 | * |
||
85 | */ |
||
86 | public function callbackSubmitFail() |
||
91 | |||
92 | |||
93 | |||
94 | /** |
||
95 | * Callback What to do if the form was submitted? |
||
96 | * |
||
97 | */ |
||
98 | public function callbackSuccess() |
||
103 | |||
104 | |||
105 | |||
106 | /** |
||
107 | * Callback What to do when form could not be processed? |
||
108 | * |
||
109 | */ |
||
110 | public function callbackFail() |
||
115 | } |
||
116 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.