Download the PHP package slm/three-step-view without Composer
On this page you can find all versions of the php package slm/three-step-view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download slm/three-step-view
More information about slm/three-step-view
Files in slm/three-step-view
Package three-step-view
Short Description A small modules that enables the three step layout pattern in your Zend Framework 2 application
License BSD-3-Clause
Homepage https://github.com/juriansluiman/SlmThreeStepView
Informations about the package three-step-view
SlmThreeStepView
SlmThreeStepView is a module to abstract common parts of your layout script into a wrapper script. It lets you focus on the important things of the layout, leaving the general parts out of its scope. This helps with creation of new layouts (you need to remember less) and helps to concentrate on the important parts of the layout script.
The result is a wrapper view script, "surrounding" the layout. A wrapper might look something like this:
The layout scripts you are used to work with, only need to contain the html within the <body></body>
tags.
Installation
SlmThreeStepView is installable via composer. Require slm/three-step-view
in your composer.json
. You can use the development's version dev-master
but also rely on the first tagged release (v0.1.0) by specifying 0.*
as version constraint. Then enable SlmThreeStepView
in your application.config.php
.
Usage
SlmThreeStepView let you configure the template of the wrapper script (defaults to layout/wrapper
) and the variable the "inner" layout is captured to (defaults to content
).
Furthermore, SlmThreeStepView allows a blacklist of layout scripts which are not turned into a three step version. This is useful when you use a module as ZfcAdmin for example, where the layout layout/admin
is a full layout. By default, this blacklist is empty.
Create the file slmthreestepview.config.global.php
in your config/autoload
directory. You can use the following configuration options:
Performance
You might wonder what the performance drop is by using this module. In a small-sized Zend Framework 2 application the module is benchmarked roughly with ab
. In 1000 requests the drop in performance is on average 1ms (from 45.739ms to 46.649ms). The resolving of the templates is done via the template path stack (so no template map has been made). This means the real performance drop of this module is even less than the 1ms of the above benchmark.
Important!
This module requires a change in your Zend Framework 2 library. The change is requested to be pulled into the core via this Pull Request. Only after this merge has been made, this module is usable.
Development
This module is developed in a short time and might not be completely stable or ready for your needs. Please test is thoroughly befor you use it in production! If you have any problems, feel free to open an issue in the tracker. If you have questions, please mail them to [email protected].