Strata\View\Template

The template object is used to generate views.

    Synopsis

    class Template {
    • // constants
    • const TPL_YIELD = "__STRATA_YIELD__";
    }

    Hierarchy

    Constants

    Name Value
    TPL_YIELD "__STRATA_YIELD__"

    Members

    private

    • $contextualVariables — array
    • $viewName — string

    protected

    • $configuration — array
      The configuration cache.

    Methods

    protected

    public

    • __construct()
    • compile() — Compiles the generated contents of the current template configuration.
    • injectVariables() — Injects variables to the template scope.
    • parse() — Parses a template file and declares view variables in this scope for the template to have access to them. Loads localized templates based on the current active locale.
    • parseFile() — Loads up the file located at $templateFilePath, assigns it $variables and saves the generated HTML.
    • setViewName() — Sets the view name which will define the name of file used to build the view.

    Inherited from Strata\Core\StrataConfigurableTrait

    protected

    • normalizeConfiguration() — Normalizes the configuration cache. This will only run once on the object. It is mainly a safegard against a badly configured value cache.

    public

    • configure() — Instantiate the configuration cache to the state supplied by $config.
    • containsConfigurations() — Returns whether the configuration cache contains something.
    • extractConfig() — Intelligently extract data from the configuration array.
    • getConfig() — Fetches a value in the configuration array
    • getConfiguration() — Returns the object's complete configuration cache.
    • hasConfig() — Confirms the presence of a value in the custom post type's configuration array
    • setConfig() — Saves a value in the object's configuration array for the duration of the runtime.