Class AlphaView
The master rendering view class for the Alpha Framework.
Copyright: Copyright (c) 2012, 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.
License: The BSD License
Author: John Collins <dev@alphaframework.org>
Version: $Id: AlphaView.inc 1563 2012-08-04 14:36:54Z alphadevx $
Since: 1.0
Located at view/AlphaView.inc
protected
|
#
__construct(
Constructor for the AlphaView. As this is protected, use the AlphaView::getInstance method from a public scope. |
public static
|
#
getInstance(
Static method which returns a AlphaView object or a custom child view for the BO specified if one exists |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
detailedView( array $fields = array() )
Displays a detailed view of the object (read-only) to standard output |
public
|
|
public static
string
|
|
public static
string
|
|
public static
string
|
#
displayUpdateMessage( string $message )
Renders the content for an update (e.g. successful save) message |
public static
string
|
#
displayErrorMessage( string $message )
Renders the content for an error (e.g. save failed) message |
public static
string
|
#
renderErrorPage( string $code, string $message )
Renders an error page with the supplied error code (typlically a HTTP code) and a message |
public static
string
|
#
renderDeleteForm( )
Method to render a hidden HTML form for posting the OID of an object to be deleted |
public 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. |
public
string
|
#
renderIntegerField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true )
Method to render the default Integer HTML |
public static
string
|
#
renderDoubleField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true )
Method to render the default Double HTML |
public
string
|
#
renderBooleanField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true )
Method to render the default Boolean HTML |
public static
string
|
#
renderEnumField( string $name, string $label, string $mode, array $options, string $value = '', boolean $tableTags = true )
Method to render the default Enum HTML |
public static
string
|
#
renderDEnumField( string $name, string $label, string $mode, array $options, string $value = '', boolean $tableTags = true )
Method to render the default DEnum HTML |
public
string
|
#
renderDefaultField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true )
Method to render the default field HTML when type is not known |
public
string
|
#
renderTextField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true )
render the default Text HTML |
public
string
|
#
renderRelationField( string $name, string $label, string $mode, string $value = '', boolean $tableTags = true, boolean $expanded = false, boolean $buttons = true )
render the default Relation HTML |
public
string
|
#
renderAllFields( string $mode, array $filterFields = array(), array $readOnlyFields = array() )
Renders all fields for the current BO in edit/create/view mode |
public static
|
#
loadTemplate(
Loads a template for the BO specified if one exists. Lower level custom templates take precedence. |
public static
|
#
loadTemplateFragment( string $type, string $fileName, array $fields )
Loads a template fragment from the renderers/[type]/fragments/[filename.ext] location. |
public
|
#
setProvider( string $ProviderClassName )
Enables you to set an explicit type of AlphaRendererProviderInterface implementation to use for rendering the business object attached to this view. Note that this has no affect on static methods of the AlphaView class, which always instantiate a new AlphaRendererProviderInterface provider each time they're called. |
protected
|
$BO |
|
#
The business object that will be rendered |
protected
|
$provider |
|
#
The rendering provider that will be used to render the business object |
private static
|
$logger | null |
#
Trace logger |