Oroboros Core
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • None
  • oroboros
    • core
      • abstracts
        • adapters
        • bootstrap
        • controllers
        • libraries
          • auth
          • bootstrap
          • cache
          • codex
          • config
          • container
          • data
          • database
          • dns
          • entity
          • enum
          • error
          • event
          • extension
          • file
          • flags
          • hooks
          • job
          • logger
          • manager
          • message
          • prototype
          • request
          • response
          • routine
          • shell
          • startup
          • stream
          • template
          • uri
          • utility
          • validation
            • workers
          • worker
        • models
        • patterns
          • behavioral
          • creational
        • utilities
          • exception
            • cache
            • container
          • http
        • views
      • interfaces
        • adapters
          • interpreters
          • sdk
        • api
          • adapters
          • bootstrap
          • controllers
          • psr
        • contract
          • adapters
          • bootstrap
          • codex
          • components
          • controllers
          • data
          • entities
          • errors
          • events
          • extensions
          • jobs
          • libraries
            • auth
            • cache
            • config
            • container
            • enum
            • file
            • flags
            • hooks
            • module
            • promise
            • record
            • request
            • response
            • server
            • shutdown
            • site
            • stream
            • template
            • theme
            • uri
          • models
          • patterns
            • behavioral
            • concurrency
            • creational
            • structural
          • routes
          • routines
            • bootload
            • declarative
            • procedural
            • subsystem
          • services
            • consumer
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
            • provider
              • cgi
              • rest
                • local
                • remote
                  • authenticated
                  • unauthenticated
          • utilities
            • datetime
            • exception
              • cache
              • container
            • filebase
            • http
            • math
            • parser
            • regex
            • session
          • views
        • enumerated
          • environment
          • flags
          • http
          • views
        • libraries
          • manager
          • worker
      • libraries
        • api
        • codex
        • container
        • enum
          • http
        • file
        • hooks
        • logger
        • math
        • psr4
        • request
        • response
        • stream
        • uri
      • patterns
        • creational
      • traits
        • adapters
        • bootstrap
        • codex
        • components
        • controllers
        • data
        • entities
        • events
        • extensions
        • jobs
        • libraries
          • container
          • file
          • request
          • response
          • stream
          • uri
        • models
        • modules
        • patterns
          • behavioral
          • concurrency
          • creational
          • structural
        • routes
        • services
        • utilities
          • core
            • api
            • config
            • contract
              • contract
            • enum
            • environment
            • routines
          • datetime
          • error
          • exception
          • filebase
          • hooks
          • html
          • http
          • logic
          • math
          • parsers
          • regex
          • session
        • views
      • utilities
        • exception
          • cache
          • container
        • http
      • views
    • tests
      • patterns
        • creational
      • psr
        • psr7
      • utilities
        • exception
  • PasswordCompat
    • binary
  • PHP

Traits

  • ViewTrait

Trait ViewTrait

Provides the methods required to satisfy the ViewContract

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

Namespace: oroboros\core\traits\views
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
# __construct( array $params = array(), array $flags = array() )

Contract Methods


Contract Methods

These methods satisfy the public api defined in the bootstrap contract

Execution

Default Execution Plan (minimal)

Default Execution Plan (commented)



Satisfies

...
public
# __destruct( )
public
# initialize( array $params = array(), array $flags = array() )
public
# redirect( $location, $internal = 1 )
public
# render( array $params = array(), array $flags = array() )
public
# reset( array $params = array(), array $flags = array() )
protected
# _buildContent( array $params = array(), array $flags = array() )

Extension Methods (protected)


Extension Methods (protected)

These methods may be extended by inheriting constructs as needed.

They represent the interal api.

protected
# _resetHeaders( )
protected
# _setHeaders( array $headers )
protected
# _processHeaders( )
protected
# _toUrl( $filepath )
protected
# _updateParameterConditions( $parameter_key )

Methods used from oroboros\core\traits\utilities\LoaderTrait

_initializeLoader(), _load(), _setAllowedLoaderTypes()

Methods used from oroboros\core\traits\utilities\DefaultLoggerTrait

_getLogger(), _log(), setLogger()

Properties summary

private array $_allowed_loader_types

These are the types of resources that can be loaded with the $this->load method

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

Properties used from oroboros\core\traits\utilities\DefaultLoggerTrait

$_DefaultLoggerTrait_logger

Oroboros Core API documentation generated by ApiGen