Download the PHP package neilime/zf2-tree-layout-stack without Composer
On this page you can find all versions of the php package neilime/zf2-tree-layout-stack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neilime/zf2-tree-layout-stack
More information about neilime/zf2-tree-layout-stack
Files in neilime/zf2-tree-layout-stack
Package zf2-tree-layout-stack
Short Description TreeLayoutStack is a module for ZF2 allowing the creation of tree layout
License MIT
Informations about the package zf2-tree-layout-stack
TreeLayoutStack
⚠️ This module is for Zend Framework 2, it is deprecated ⚠️
NOTE : If you want to contribute don't hesitate, I'll review any PR.
Introduction
TreeLayoutStack is module for ZF2 allowing the creation of tree layout
Requirements
- Zend Framework 2 (latest master)
Installation
Main Setup
By cloning project
- Clone this project into your
./vendor/
directory.
With composer
-
Add this project in your composer.json:
- Now tell composer to download TreeLayoutStack by running the command:
Post installation
- Enabling it in your
application.config.php
file.
How to use TreeLayoutStack
Simple configuration example
This example shows how to define a simple tree layout stack with header and footer parts
-
After installing skeleton application, install TreeLayoutStack as explained above.
-
Edit the application module configuration file
module/Application/config/module.config.php
, adding the configuration fragment below:php
//... echo $this->header; //Display header part //...//... echo $this->layout()->content; //Display content part //... //... echo $this->layout()->footer; //Display footer part //...
-
Create header and footer view files
module/Application/view/layout/header.phtml
module/Application/view/layout/footer.phtml
- Save & Resfresh.
Configuration
-
TreeLayoutStack :
- array
layout_tree
: Define the layout tree, you can define differents tree layout stack, depends on module name, thedefault
configuration is used if no template is defined for current module
- array
-
Module layout tree map (
layout_tree
entry) :- string|array|callable template : define the template name
- array children : (optionnal) define children of the template, the configuration is the same as the
layout_tree
entry ortemplate
Complexe exemple
This example shows all the configuration options available, it assume that template_map
is properly defined in view_manager
configuration