[cvs] [Wiki] changed: Doc/Dev/Horde_View

Michael Rubinsky mrubinsk at horde.org
Mon Feb 23 17:48:52 UTC 2009


mrubinsk  Mon, 23 Feb 2009 12:48:52 -0500

Modified page: http://wiki.horde.org/Doc/Dev/Horde_View
New Revision:  1.4
Change log:  typos

@@ -157,11 +157,11 @@
  +++ Overview

  Views separate the presentation from the controllers and models.  
Views are allowed to have logic, provided that the logic is only for  
presentation purposes. This presentation logic is small bits of PHP  
code embedded in the HTML.

-Bits of presentation logic code can be extracted into helper methods.  
Once extracted, a helper method can be called in the view in place of  
the former code block. Extracting presentation logic into helpers is a  
best practice and helps views clean and DRY.
+Bits of presentation logic code can be extracted into helper methods.  
Once extracted, a helper method can be called in the view in place of  
the former code block. Extracting presentation logic into helpers is a  
best practice and helps keep views clean and DRY.

-Helpers are simply methods of a class. The framework mixes the  
helpers into the view behind the scenes, and makes the appear as  
methods inside the view. An example of a helper class with a single  
{{highlight()}} helper follows:
+Helpers are simply methods of a class. The framework mixes the  
helpers into the view behind the scenes, and makes them appear as  
methods inside the view. An example of a helper class with a single  
{{highlight()}} helper follows:

  <code type="php">
  class UsersHelper extends ApplicationHelper
  {
@@ -193,5 +193,5 @@
  It is OK to put HTML into helper class methods because they exist to  
assist with presentation. However, it is NOT OK to put print/echo  
statements within a helper class. Helper methods always return a value  
that is displayed in the view like {{<?= $this->highlight($text) ?>}}.

  +++ Organization

-As shown above, helpers are methods that are organized into classes.  
The framework will mix helper methods together through overloading.  
Inside a view, helper methods from all of the sources above be called  
by simply using {{<?= $this->helperMethod() ?>}}.
+As shown above, helpers are methods that are organized into classes.  
The framework will mix helper methods together through overloading.  
Inside a view, helper methods from all of the sources above can be  
called by simply using {{<?= $this->helperMethod() ?>}}.



More information about the cvs mailing list