Alpha Framework 3.0.0 API Documentation
  • Namespace
  • Class

Namespaces

  • Alpha
    • Controller
      • Front
    • Exception
    • Model
      • Type
    • Task
    • Util
      • Backup
      • Cache
      • Code
        • Highlight
        • Metric
      • Config
      • Convertor
      • Email
      • Extension
      • Feed
      • File
      • Graph
      • Helper
      • Http
        • Filter
        • Session
      • Image
      • Logging
      • Search
      • Security
      • Service
    • View
      • Renderer
        • Html
        • Json
      • Widget

Classes

  • RendererProviderHTML

Class RendererProviderHTML

HTML renderer. Will invoke widgets from the Alpha\View\Widgets package automatically for the correct data type. Templates from ./templates/html will be loaded by default, but these can be overridden on a per-record level in the application when required (consider the default ones to be scaffolding).

Alpha\View\Renderer\Html\RendererProviderHTML implements Alpha\View\Renderer\RendererProviderInterface
Namespace: Alpha\View\Renderer\Html
Copyright:

Copyright (c) 2018, 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
Since: 1.2
Located at View/Renderer/Html/RendererProviderHTML.php

Methods summary

public
# __construct( )

The constructor.

The constructor.

Since

1.2
public
# setRecord( Alpha\Model\ActiveRecord $Record )

Provide the Record that we are going render.

Provide the Record that we are going render.

Parameters

$Record

Implementation of

Alpha\View\Renderer\RendererProviderInterface::setRecord()
public string
# createView( array $fields = array() )

Renders the create view for the Record using the selected renderer.

Renders the create view for the Record using the selected renderer.

Parameters

$fields
Hash array of fields to pass to the template.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::createView()
public string
# editView( array $fields = array() )

Renders the edit view for the Record using the selected renderer.

Renders the edit view for the Record using the selected renderer.

Parameters

$fields
Hash array of fields to pass to the template.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::editView()
public string
# listView( array $fields = array() )

Renders the list view for the Record using the selected renderer.

Renders the list view for the Record using the selected renderer.

Parameters

$fields
Hash array of fields to pass to the template.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::listView()
public string
# detailedView( array $fields = array() )

Renders the detailed read-only view for the Record using the selected renderer.

Renders the detailed read-only view for the Record using the selected renderer.

Parameters

$fields
Hash array of fields to pass to the template.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::detailedView()
public string
# adminView( array $fields = array() )

Renders the admin view for the Record using the selected renderer.

Renders the admin view for the Record using the selected renderer.

Parameters

$fields
Hash array of fields to pass to the template.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::adminView()
public static string
# displayPageHead( Alpha\Controller\Controller $controller )

Renders the header content using the given renderer.

Renders the header content using the given renderer.

Parameters

$controller

Returns

string

Throws

Alpha\Exception\IllegalArguementException

Implementation of

Alpha\View\Renderer\RendererProviderInterface::displayPageHead()
public static string
# displayPageFoot( Alpha\Controller\Controller $controller )

Renders the footer content using the given renderer.

Renders the footer content using the given renderer.

Parameters

$controller

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::displayPageFoot()
public static string
# displayUpdateMessage( string $message )

Renders an update (e.g. successful save) message.

Renders an update (e.g. successful save) message.

Parameters

$message

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::displayUpdateMessage()
public static string
# displayErrorMessage( string $message )

Renders an error (e.g. save failed) message.

Renders an error (e.g. save failed) message.

Parameters

$message

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::displayErrorMessage()
public static string
# renderErrorPage( string $code, string $message )

Renders an error page with the supplied HTTP error code and a message.

Renders an error page with the supplied HTTP error code and a message.

Parameters

$code
$message

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderErrorPage()
public static string
# renderDeleteForm( string $URI )

Method to render a hidden HTML form for posting the ID of an object to be deleted.

Method to render a hidden HTML form for posting the ID of an object to be deleted.

Parameters

$URI
The URI that the form will point to

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderDeleteForm()
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.

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.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderSecurityFields()
public string
# renderIntegerField( string $name, string $label, string $mode, string $value = '' )

Renders an Integer field value.

Renders an Integer field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderIntegerField()
public string
# renderDoubleField( string $name, string $label, string $mode, string $value = '' )

Renders an Double field value.

Renders an Double field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderDoubleField()
public string
# renderBooleanField( string $name, string $label, string $mode, string $value = '' )

Renders an Boolean field value.

Renders an Boolean field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderBooleanField()
public string
# renderEnumField( string $name, string $label, string $mode, array $options, string $value = '' )

Renders an Enum field value.

Renders an Enum field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$options
The Enum options
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderEnumField()
public string
# renderDEnumField( string $name, string $label, string $mode, array $options, string $value = '' )

Renders an DEnum field value.

Renders an DEnum field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$options
The DEnum options
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderDEnumField()
public string
# renderDefaultField( string $name, string $label, string $mode, string $value = '' )

Method to render a field when type is not known.

Method to render a field when type is not known.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderDefaultField()
public string
# renderTextField( string $name, string $label, string $mode, string $value = '' )

Renders a Text field value.

Renders a Text field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderTextField()
public string
# renderStringField( string $name, string $label, string $mode, string $value = '' )

Renders a String field value.

Renders a String field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderStringField()
public string
# renderRelationField( string $name, string $label, string $mode, string $value = '', boolean $expanded = false, boolean $buttons = true )

Renders a Relation field value.

Renders a Relation field value.

Parameters

$name
The field name
$label
The label to apply to the field
$mode
The field mode (create/edit/view)
$value
The field value (optional)
$expanded
Render the related fields in expanded format or not (optional)
$buttons
Render buttons for expanding/contacting the related fields (optional)

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderRelationField()
public string
# renderAllFields( string $mode, array $filterFields = array(), array $readOnlyFields = array() )

Convenience method that renders all fields for the current Record in edit/create/view mode.

Convenience method that renders all fields for the current Record in edit/create/view mode.

Parameters

$mode
(view|edit|create)
$filterFields
Optional list of field names to exclude from rendering.
$readOnlyFields
Optional list of fields to render in a readonly fashion when rendering in create or edit mode.

Returns

string

Implementation of

Alpha\View\Renderer\RendererProviderInterface::renderAllFields()
Alpha Framework 3.0.0 API Documentation API documentation generated by ApiGen