Strata\View\View

Handles the generation of view html. It is important to understand this is not used when a request continues the regular Wordpress flow which generates its own templates.

This class is used when a controller is printing the view object itself, as it is often the
case for AJAX, file downloads and numeric returns.

    Synopsis

    class View {
    }

    Hierarchy

    Members

    protected

    • $configuration — array
      The configuration cache.
    • $templateVars — array
      The list of variables to be declared when loading the view

    Methods

    protected

    • applyHeaders() — Applies PHP header values sent as options. For the time being, only Content-type and Content-disposition are supported.
    • getDefaultConfiguration() — Returns the list of default view configuration values.
    • parseCurrentContent() — Takes the current value of the content option and ensure that it is correctly formatted for output. If the content is an array or an object, the value.

    public

    • check() — Checks whether a variable is assigned to the current view
    • get() — Returns a variable assigned to the current view
    • getVariables() — Returns the list of currently declared variables in this view.
    • loadHelper() — Loads and declares a ViewHelper in the current view instance.
    • loadTemplate() — Compiles a template using the file located at $path
    • render() — Renders on the page and end the process. Useful for simple HTML returns or data in another format like JSON.
    • set() — Assigns the variable to the current 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.