openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

README.md (836B)


      1 # And... Action!
      2 
      3 These action classes are the 'presenter' part in the [model-view-presenter](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter).
      4 
      5 
      6 Their mission is to
      7 - validate input data
      8 - calling the model
      9 - providing all data for the UI.
     10 
     11 ### View and Post
     12 
     13 Every HTTP-Request contains 3 parameters: 
     14 - `action`: The action pointing to an model object
     15 - `method`: The method
     16 - `id`    : The id of the model object. This is optional in some cases
     17 
     18 ### View and Post
     19 
     20 The parameter `method` and the HTTP method are deciding, which method is called.
     21 
     22 Example:
     23 `GET  /?action=example&method=foo` will call _ExampleFooAction::view()_.
     24 `POST /?action=example&method=foo` will call _ExampleFooAction::post()_.
     25 
     26 ### Contracts:
     27 - **no database requests are done here!** Database requests are only done by the model classes.