Skip to content

Commit

Permalink
Adding explanation for View to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
woxxy committed Dec 16, 2012
1 parent 9b12005 commit c50cc36
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Other features:
* Asset Manager: compile LESS files on the fly.


## Classes

#### Theme

The Theme object abstracts the content of the theme. These will be returned by the Loader, and you will be able to choose which to use.
Expand Down Expand Up @@ -112,3 +114,32 @@ Parameter managers are used to consistently store variables for being used in th

#### View

The View returned by the Builder is most often a custom object extending \Foolz\Theme\View.

__It's compulsory to override the `toString()` method (not the `__toString()` magic method!) in order to output the HTML. This function should output HTML or return a string.__

* __$view->toString()__

Called when the HTML must be generated. It should contain the classic HTML building logic. `$this` can be used. No manual output buffering is necessary.

* __$view->getType()__

Returns the type of View. `layout` or `partial`.

* __$view->getView()__

Returns the name of the View.

* __$view->getParamManager()__

Returns the local parameter manager.

* __$view->build()__

Builds _and cached_ the HTML. Returns the HTML.

* __$view->doBuild()__

Builds the HTML and stores it in a variable. Rebuilds the HTML every time it's called.

__CHAINABLE__

0 comments on commit c50cc36

Please sign in to comment.