MvcLite\View
Base View Class
- Author: Cory Collier <corycollier@corycollier.com>
Synopsis
- // constants
- const DEFAULT_FORMAT = 'html';
- const ERR_BAD_HELPER_NAME = "Requested view helper [%s] could not be found";
- const ERR_BAD_FORMAT = "The format given [%s] is not supported";
- // Inherited constants from ObjectAbstract
- const MSG_ERR_IDENTIFY = 'Descendents must implement the identify method';
- // members
- protected array $vars = ;
- protected array $helpers = ;
- protected $script;
- protected $layout;
- protected string $format = self::DEFAULT_FORMAT;
- protected array $viewScriptPaths = ;
- // methods
- public View init()
- public string getFormat()
- public View setFormat()
- public View addViewScriptPath()
- public array getViewScriptPaths()
- public View setScript()
- public string getScript()
- public View setLayout()
- public string getLayout()
- public string getViewScript()
- public string getLayoutScript()
- public string render()
- public string filter()
- public View set()
- public mixed get()
- public View_Helper getHelper()
- // Inherited methods from ObjectAbstract
- public final void __get()
- public final void __set()
- public final void __call()
- public void __toString()
- public string identify()
- // Inherited methods from Singleton
- public static Singleton getInstance()
- // Inherited methods from Filepath
- public Request filepath()
- // Inherited methods from Request
- public Request getRequest()
- // Inherited methods from Session
- public Session getSession()
- // Inherited methods from Config
- public Config getConfig()
Hierarchy
Extends
Uses
Coverage
Methods | 0% | 0 / 16 |
Lines | 0% | / |
Constants
Name | Value |
---|---|
DEFAULT_FORMAT | 'html' |
ERR_BAD_HELPER_NAME | "Requested view helper [%s] could not be found" |
ERR_BAD_FORMAT | "The format given [%s] is not supported" |
MSG_ERR_IDENTIFY | 'Descendents must implement the identify method' |
Members
protected
- $config
—
MvcLite\Traits\MvcLite\Config
Config instance variable. - $format
—
string
The format type for the view - $helpers
—
array
a list of previously loaded view helpers - $instance
—
MvcLite\Traits\Singleton
Static instance variable - $layout
—
string
The name of the layout script to be used - $loader
—
\Composer\Autoload\ClassLoader
Loader instance variable. - $request
—
MvcLite\Traits\MvcLite\Request
Request instance variable. - $script
—
string
The name of the view script to be used - $session
—
MvcLite\Traits\MvcLite\Session
Session instance variable. - $vars
—
array
Variables assigned to the view - $viewScriptPaths
—
array
The list of paths used to search for view scripts.
Methods
public
- addViewScriptPath() — Method to add a path to the list of paths used to search for view scripts
- filter() — Method to filter string input
- get() — getter for the _vars property
- getFormat() — Getter for the format.
- getHelper() — getter for a view helper instance
- getLayout() — Returns the layout script name
- getLayoutScript() — Returns the layout script;
- getScript() — Method to get the script attribute
- getViewScript() — Gets the view script
- getViewScriptPaths() — return the view script paths, reversed to enforce LIFO
- init() — method to start the view.
- render() — Method to render the view
- set() — Setter for the _vars property.
- setFormat() — Setter for the format.
- setLayout() — Method to set the layout attribute
- setScript() — Method to set the script attrubute
Inherited from MvcLite\ObjectAbstract
public
- __call() — Overriding the __call magic method
- __get() — Overriding the __get magic method
- __set() — Overriding the __set magic method
- __toString() — returns a string representation of the object
- identify() — method used to identify the object instance
Inherited from MvcLite\Traits\Singleton
public
- getInstance() — Getter for the instance variable.
Inherited from MvcLite\Traits\Filepath
public
- filepath() — Getter for the Request instance.
Inherited from MvcLite\Traits\Loader
public
- getLoader() — Getter for the Loader instance.
- setLoader() — Setter for the Loader instance.
Inherited from MvcLite\Traits\Request
public
- getRequest() — Getter for the Request instance.
Inherited from MvcLite\Traits\Session
public
- getSession() — Getter for the session instance variable.
Inherited from MvcLite\Traits\Config
public
- getConfig() — Getter for the config.
History
-
2015-12-21T13:08:25-05:00 (commit #5617538)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Updating the response class to allow for setting/getting of content type. Updating the request to read the content type, allowing for semicolon separated values, implementing the content-type acknowledgement in the dispatcher
-
2015-12-17T11:21:34-05:00 (commit #b93b112)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Adding support for section reading from the Config object. Setting default values to the view from the configuration. Adding the autoloader to the View, and using it to check for helper classes. Updating unit tests for the Request object. Implementation of Bootstrap in the default views created by the mvc script
-
2015-12-17T00:04:48-05:00 (commit #afe5446)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Adding text as a recognized content type. This is to accomodate cli requests
-
2015-12-16T21:16:45-05:00 (commit #56c2c5b)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
First commit of the 3.2.0 release branch. Adding format changing for the response
-
2015-12-16T10:02:24-05:00 (commit #567d8de)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Adding unit test coverage to the View class, and giving the addViewScript method a return value ()
-
2015-12-15T09:42:10-05:00 (commit #0bcf089)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
A lot of code minor code cleanup. Updating some methods to split up code a bit
-
2015-12-14T22:01:17-05:00 (commit #3ca33f8)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
General code cleanup. Also getting unit test coverage for the Dispatcher up to 100%
-
2015-12-14T07:03:35-05:00 (commit #ca452e0)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Removing the Database class, trait, and associated tests. Cleaning up some of the declarations on the filter and view helper classes
-
2015-12-14T06:40:22-05:00 (commit #dd3ea25)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Updating a few source files, adding a coveralls config file, adding an abstract model class
-
2015-12-02T16:43:15-05:00 (commit #55a67b0)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
BIG commit. Leveraging php5.4 shorthand for arrays, updating the skeleton app, Adding the Filepath trait, implementing the filepath trait, new Filters, Moved the registry to a new config class, created a new config trait, implemented new config trait, updated a TON of unit tests
-
2015-11-30T18:03:08-05:00 (commit #edb2b58)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
LOTS of code cleanup here. Fixing unit tests for those cleanups as well
-
2015-11-29T18:44:56-05:00 (commit #7d443b7)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
A TON of phpcs changes, and updates to accomodate namespacing the view helper classes
-
2015-11-29T18:13:17-05:00 (commit #2aa2bf7)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
Fixing phpcs issues in the View and associated TestCase class. Fixing unit tests for the View
-
2015-11-29T13:59:13-05:00 (commit #5ca1372)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
,
-
2015-11-27T22:46:57-05:00 (commit #3067c88)
Author: Cory Collier (ccollier@redhat.com) / Commiter: Cory Collier (ccollier@redhat.com)
Provisional commit - Not done moving things around to be namespace compliant. This commit is completely not functional
-
2015-11-11T08:14:50-05:00 (commit #ad28461)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
More moving things around
-
2015-11-11T08:07:21-05:00 (commit #3838504)
Author: Cory Collier (corycollier@corycollier.com) / Commiter: Cory Collier (corycollier@corycollier.com)
Re-introducing the library components as first class items