Trait ViewTrait
- oroboros\core\traits\views\ViewTrait uses oroboros\core\traits\utilities\LoaderTrait, oroboros\core\traits\utilities\DefaultLoggerTrait
Direct Known Users
oroboros\core\abstracts\adapters\AbstractAdapter
,
oroboros\core\abstracts\views\AbstractView
Indirect Known Users
oroboros\core\abstracts\adapters\AbstractBrowserAdapter
,
oroboros\core\abstracts\adapters\AbstractDatabaseAdapter
,
oroboros\core\abstracts\views\AbstractHtmlView
,
oroboros\core\abstracts\views\AbstractJavascriptView
,
oroboros\core\abstracts\views\AbstractPlaintextView
,
oroboros\core\abstracts\views\AbstractRssView
,
oroboros\core\abstracts\adapters\AbstractLibraryAdapter
,
oroboros\core\abstracts\adapters\AbstractProxyAdapter
,
oroboros\core\abstracts\adapters\AbstractSdkAdapter
,
oroboros\core\abstracts\adapters\AbstractServiceAdapter
,
oroboros\core\abstracts\adapters\AbstractShellAdapter
,
oroboros\core\abstracts\adapters\AbstractSocketAdapter
,
oroboros\core\abstracts\libraries\shell\AbstractShell
,
oroboros\core\abstracts\views\AbstractCssView
Package: oroboros\core\
Category: contract-interfaces
License: The MIT License (MIT)
Author: Brian Dayhoff mopsyd@me.com
Version
Since
Link: bitbucket.org/oroborosframework/oroboros-core/wiki/development/api/contract_interface.md
Note:
This trait needs some refactoring and better abstraction, because of the following problems inherited from it's original representation: -Direct reliance on class constants in the implementing class (because it used to be a class, and did have these) -Factor out the opinion. This representation ASSUMES http (which was appropriate in its original expression), and this MUST be factored out before it is offered as a concrete construct in release. -Some opinion here is unavoidable, so it should be as follows: plaintext, utf-8 by default (with a means to change encoding without further extension of the trait), null headers (so it does not disrupt either cli or http, which both inherit from this), null template (it will use one that does nothing to satisfy the requirement, but SHALL NOT mutate content in any way from it's direct representation, EXCEPT to make it scalar if it is not, so that it may be printed efficiently) -Factor the logic down to private methods, and factor the auth/validation to protected methods, as per the build specs -As this is a base level abstraction, it MAY be required to provide some nulled methods that clear checks for http that may occur, but they MUST effect no operation in THIS view (child traits of this one may enact them at their discretion).
Traits provide extended method support to classes without requiring a direct, linear chain of inheritance. This allows functions to inherit subsets of related methods without declaring a parent class.
In Oroboros core, ALL methods are granted to classes via traits, and the classes themselves are just containers that correlate their methods to an interface they are expected to honor. This approach maximizes interoperability, by entirely removing class inheritance as a requirement for extension of any class in this system.
3rd parties using this package are not expected to follow this approach,
but ALL of our internal class and logic structure does.
Located at core/traits/views/ViewTrait.php
Methods summary
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
Methods used from oroboros\core\traits\utilities\LoaderTrait
Methods used from oroboros\core\traits\utilities\DefaultLoggerTrait
Properties summary
private
array
|
$_allowed_loader_types
These are the types of resources that can be loaded with the $this->load method |
#
array(
"library",
"module",
"template",
"theme"
)
|
private
array
|
$_valid_output_modes
|
#
array(
"plaintext" => self::FLAG_OUTPUT_PLAINTEXT, //refactor this out not to directly rely on class constants
"html" => self::FLAG_OUTPUT_HTML,
"css" => self::FLAG_OUTPUT_CSS,
"javascript" => self::FLAG_OUTPUT_JAVASCRIPT,
"email" => self::FLAG_OUTPUT_EMAIL,
"rss" => self::FLAG_OUTPUT_RSS,
"cron" => self::FLAG_OUTPUT_CRON,
"robots" => self::FLAG_OUTPUT_ROBOTS,
"sitemap" => self::FLAG_OUTPUT_SITEMAP,
)
|
private
|
$_output_mode
|
|
private
array
|
$_headers
|
#
array('Content-Type' => self::CONTENT_TYPE)
|
private
array
|
$_meta
|
#
array()
|
private
array
|
$_css
|
#
array()
|
private
array
|
$_scripts
|
#
array()
|
private
array
|
$_fonts
|
#
array()
|
private
array
|
$_content
|
#
array()
|
private
|
$_base_url
|
#
OROBOROS_URL
|
Properties used from oroboros\core\traits\utilities\LoaderTrait
$_LoaderTrait_allowed_types
,
$_LoaderTrait_factory
,
$_LoaderTrait_loader_initialized
,
$_LoaderTrait_loader_types