| alpha--view

# Class: AlphaView Source Location: /view/AlphaView.inc ## Class AlphaView Class Overview
The master rendering view class for the Alpha Framework. Located in /view/AlphaView.inc [line 66]
Author(s): John Collins <dev@alphaframework.org> Information Tags:
Version: | $Id: AlphaView.inc 1453 2011-12-04 15:12:54Z johnc $
Copyright: | Copyright (c) 2011, John Collins (founder of Alpha Framework). All rights reserved.
     Redistribution and use in source and binary forms, with or
     without modification, are permitted provided that the
     following conditions are met:

     * Redistributions of source code must retain the above
       copyright notice, this list of conditions and the
       following disclaimer.
     * Redistributions in binary form must reproduce the above
       copyright notice, this list of conditions and the
       following disclaimer in the documentation and/or other
       materials provided with the distribution.
     * Neither the name of the Alpha Framework nor the names
       of its contributors may be used to endorse or promote
       products derived from this software without specific
       prior written permission.

     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Since: | 1.0
License: | The BSD License
| Properties $BO | Methods __construct adminView createView detailedView displayErrorMessage displayPageFoot displayPageHead displayUpdateMessage editView getBO getInstance listView loadTemplate renderAllFields renderBooleanField renderDefaultField renderDeleteForm renderDEnumField renderDoubleField renderEnumField renderErrorPage renderIntegerField renderRelationField renderSecurityFields renderTextField setBO
[ Top ] Descendants
Child Class | Description
--- | ---
ArticleCommentView | The rendering class for the ArticleCommentObject class
ArticleView | The rendering class for the ArticleObject class
DEnumView | The rendering class for the DEnum class
PersonView | The rendering class for the PersonObject class
SequenceView | The rendering class for the Sequence class
[ Top ] Property Summary
AlphaDAO | $BO | The business object that will be rendered
[ Top ] Method Summary
static string | displayErrorMessage() | Renders the HTML for an error (e.g. save failed) message
static string | displayPageFoot() | Method to render the page footer HTML
static string | displayPageHead() | Method to render the page header HTML content
static string | displayUpdateMessage() | Renders the HTML for an update (e.g. successful save) message
static AlphaView | getInstance() | Static method which returns a AlphaView object or a custom child view for the BO specified if one exists
static string | renderDeleteForm() | Method to render a hidden form for posting the OID of an object to be deleted
static string | renderDEnumField() | Method to render the default DEnum HTML
static string | renderDoubleField() | Method to render the default Double HTML
static string | renderEnumField() | Method to render the default Enum HTML
static string | renderErrorPage() | Renders a HTML error page with the supplied error code (typlically a HTTP code) and a message
static string | renderSecurityFields() | Method to render a HTML form with two hidden, hashed (MD5) form fields to be used as a check to ensure that a post to the controller is being sent from the same server as hosting it.
AlphaView | __construct() | Constructor for the AlphaView. As this is protected, use the AlphaView::getInstance method from a public scope.
void | adminView() | Renders the admin view for the business object screen to standard output
void | createView() | Renders the default create view to standard output
void | detailedView() | Displays a detailed view of the object (read-only) to standard output
void | editView() | Renders a form to enable object editing to standard output
AlphaDAO | getBO() | Gets the BO attached to this view (if any)
void | listView() | Renders the list view to standard output
void | loadTemplate() | Loads a .phtml template for the BO specified if one exists. Lower level custom templates take precedence.
string | renderAllFields() | Renders all fields for the current BO in edit/create/view mode
string | renderBooleanField() | Method to render the default Boolean HTML
string | renderDefaultField() | Method to render the default field HTML when type is not known
string | renderIntegerField() | Method to render the default Integer HTML
string | renderRelationField() | render the default Relation HTML
string | renderTextField() | render the default Text HTML
void | setBO() | Simple setter for the view business object
[ Top ] Properties AlphaDAO $BO [line 73] The business object that will be rendered API Tags:
Access: | protected
Information Tags:
Since: | 1.0
[ Top ] Methods static method displayErrorMessage [line 814]
`static string displayErrorMessage( string $message )`
Renders the HTML for an error (e.g. save failed) message Parameters:
string | $message: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method displayPageFoot [line 766]
`static string displayPageFoot( AlphaController $controller )`
Method to render the page footer HTML Parameters:
AlphaController | $controller: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method displayPageHead [line 590]
`static string displayPageHead( AlphaController $controller, [bool $renderMenu = true], [bool $renderStatus = true] )`
Method to render the page header HTML content Parameters:
AlphaController | $controller: |
bool | $renderMenu: | Set to false to hide the default menu (default value is true)
bool | $renderStatus: | Set to false to hide the status message from the session (if any, default value is true)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Throws: | IllegalArguementException
[ Top ] static method displayUpdateMessage [line 794]
`static string displayUpdateMessage( string $message )`
Renders the HTML for an update (e.g. successful save) message Parameters:
string | $message: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method getInstance [line 111]
`static AlphaView getInstance( AlphaDAO $BO, [boolean $returnParent = false] )`
Static method which returns a AlphaView object or a custom child view for the BO specified if one exists Parameters:
AlphaDAO | $BO: | The main business object that this view is going to render
boolean | $returnParent: | Flag to enforce the return of this object instead of a child (defaults to false)
API Tags:
Return: | Returns a AlphaView object, or a child view object from the /view directory if one exists for this BO
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderDeleteForm [line 859]
`static string renderDeleteForm( )`
Method to render a hidden form for posting the OID of an object to be deleted API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderDEnumField [line 1134]
`static string renderDEnumField( string $name, string $label, string $mode, array $options, [string $value = ''], [bool $tableTags = true] )`
Method to render the default DEnum HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
array | $options: | The DEnum options
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderDoubleField [line 956]
`static string renderDoubleField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true] )`
Method to render the default Double HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderEnumField [line 1065]
`static string renderEnumField( string $name, string $label, string $mode, array $options, [string $value = ''], [bool $tableTags = true] )`
Method to render the default Enum HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
array | $options: | The Enum options
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderErrorPage [line 835]
`static string renderErrorPage( string $code, string $message )`
Renders a HTML error page with the supplied error code (typlically a HTTP code) and a message Parameters:
string | $code: |
string | $message: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] static method renderSecurityFields [line 881]
`static string renderSecurityFields( )`
Method to render a HTML form with two hidden, hashed (MD5) form fields to be used as a check to ensure that a post to the controller is being sent from the same server as hosting it. API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] Constructor __construct [line 90]
`AlphaView __construct( AlphaDAO $BO )`
Constructor for the AlphaView. As this is protected, use the AlphaView::getInstance method from a public scope. Parameters:
AlphaDAO | $BO: |
API Tags:
Access: | protected
Information Tags:
Throws: | IllegalArguementException
Since: | 1.0
Redefined in descendants as: SequenceView::__construct() : Constructor [ Top ] adminView [line 472]
`void adminView( [array $fields = array()] )`
Renders the admin view for the business object screen to standard output Parameters:
array | $fields: | Hash array of HTML fields to pass to the template
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] createView [line 183]
`void createView( [array $fields = array()] )`
Renders the default create view to standard output Parameters:
array | $fields: | Hash array of HTML fields to pass to the template
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: ArticleCommentView::createView() : Renders the custom create view [ Top ] detailedView [line 413]
`void detailedView( [array $fields = array()] )`
Displays a detailed view of the object (read-only) to standard output Parameters:
array | $fields: | Hash array of HTML fields to pass to the template
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: SequenceView::detailedView() : Custom display view [ Top ] editView [line 224]
`void editView( [array $fields = array()] )`
Renders a form to enable object editing to standard output Parameters:
array | $fields: | Hash array of HTML fields to pass to the template
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: ArticleCommentView::editView() : Custom edit view ArticleView::editView() : Renders a form to enable article editing with attachments options DEnumView::editView() : Custom edit view [ Top ] getBO [line 173]
`AlphaDAO getBO( )`
Gets the BO attached to this view (if any) API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] listView [line 285]
`void listView( [array $fields = array()] )`
Renders the list view to standard output Parameters:
array | $fields: | Hash array of HTML fields to pass to the template
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Redefined in descendants as: ArticleView::listView() : Renders the list view (adds the dateAdded field for the list template) DEnumView::listView() : Custom list view SequenceView::listView() : Custom list view [ Top ] loadTemplate [line 1520]
`void loadTemplate( AlphaDAO $BO, string $mode, array $fields )`
Loads a .phtml template for the BO specified if one exists. Lower level custom templates take precedence. Parameters:
AlphaDAO | $BO: |
string | $mode: |
array | $fields: |
API Tags:
Access: | public
Information Tags:
Since: | 1.0
Throws: | IllegalArguementException
[ Top ] renderAllFields [line 1397]
`string renderAllFields( string $mode, [array $filterFields = array()], [array $readOnlyFields = array()] )`
Renders all fields for the current BO in edit/create/view mode Parameters:
string | $mode: | (view|edit|create)
array | $filterFields: | Optional list of field names to exclude from rendering
array | $readOnlyFields: | Optional list of fields to render in a readonly fashion when rendering in create or edit mode
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] renderBooleanField [line 1004]
`string renderBooleanField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true] )`
Method to render the default Boolean HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] renderDefaultField [line 1202]
`string renderDefaultField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true] )`
Method to render the default field HTML when type is not known Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] renderIntegerField [line 908]
`string renderIntegerField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true] )`
Method to render the default Integer HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] renderRelationField [line 1339]
`string renderRelationField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true], [bool $expanded = false], [bool $buttons = true] )`
render the default Relation HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
bool | $expanded: | Render the related fields in expanded format or not (optional)
bool | $buttons: | Render buttons for expanding/contacting the related fields (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] renderTextField [line 1267]
`string renderTextField( string $name, string $label, string $mode, [string $value = ''], [bool $tableTags = true] )`
render the default Text HTML Parameters:
string | $name: | The field name
string | $label: | The label to apply to the field
string | $mode: | The field mode (create/edit/view)
string | $value: | The field value (optional)
bool | $tableTags: | Include table tags and label (optional)
API Tags:
Access: | public
Information Tags:
Since: | 1.0
[ Top ] setBO [line 156]
`void setBO( AlphaDAO $BO )`
Simple setter for the view business object Parameters:
AlphaDAO | $BO: |
API Tags:
Access: | public
Information Tags:
Throws: | IllegalArguementException
Since: | 1.0
[ Top ] Documentation generated on Tue, 13 Dec 2011 20:26:22 +0000 by phpDocumentor 1.4.3