Element interface¶
-
interface
Element
¶ The root class for any form element. This includes controls (input boxes, select, textarea), stack items (fieldset, actions) as well as containers (forms),
-
Element::
setDate
($year, $month, $day)¶ Set the date.
Parameters: - $year (int) – The year.
- $month (int) – The month.
- $day (int) – The day.
Returns: Either false on failure, or the datetime object for method chaining.
-
Element::
setTime
($hour, $minute[, $second])¶ Set the time.
Parameters: - $hour (int) – The hour
- $minute (int) – The minute
- $second (int) – The second
Returns: Either false on failure, or the datetime object for method chaining.
-
constant
Element::
ATOM
¶ Y-m-dTH:i:sP
By convention CakePHP renders a view with an inflected version of the action
name. Returning to our online bakery example, our RecipesController might contain the
view()
, share()
, and search()
actions. The controller would be found
in /app/Controller/RecipesController.php
and contain:
# /app/Controller/RecipesController.php
class RecipesController extends AppController {
public function view($id) {
//action logic goes here..
}
public function share($customerId, $recipeId) {
//action logic goes here..
}
public function search($query) {
//action logic goes here..
}
}