2017 © Pedro Peláez
 

library zf2-params-helper

View Helper for reading data from $_GET, $_POST and Routes in view

image

tasmaniski/zf2-params-helper

View Helper for reading data from $_GET, $_POST and Routes in view

  • Wednesday, October 12, 2016
  • by tasmaniski
  • Repository
  • 5 Watchers
  • 4 Stars
  • 1,720 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

IMPORTANT NOTE: 
If you find this package useful, 
please click on a star button and let me know, 
so I will gladly continue with the updates.

Laminas MVC Params Helper

View Helper will read params from $_GET, $_POST and Routes in Laminas MVC project., (*1)

Install

Add in you composer.json file:, (*2)

{
    "require": {
        "tasmaniski/laminas-params-helper": "^3.0"
    }
}

After running: composer update, (*3)

You need to register new module. Add in file config/application.config.php:, (*4)

'modules' => array(
    '...',
    'ParamsHelper'
),

Use

We can use it in any view file (including layout) as key name params(). View Helper params() served to read variables from $_POST, $_GET or from Routes., (*5)

//will read all variables from $_POST
$this->params()->fromPost();

//will read all variables from Routes
$this->params()->fromRoute();

//will read all variables from $_GET
$this->params()->fromQuery();

Or you can get one variable by name. Second param is optional and it's default value if helper can not find the key., (*6)

//will read var with name 'id' and if id is null it will return 1 as default
$this->params()->fromRoute('id', 1);

The Versions

12/10 2016

dev-master

9999999-dev https://github.com/tasmaniski

View Helper for reading data from $_GET, $_POST and Routes in view

  Sources   Download

The Requires

 

by Aleksandar Varnicic

helper zend framework view params

12/10 2016

2.0.0

2.0.0.0 https://github.com/tasmaniski

View Helper for reading data from $_GET, $_POST and Routes in view

  Sources   Download

The Requires

 

by Aleksandar Varnicic

helper zend framework view params

12/11 2015

1.0.1

1.0.1.0 https://github.com/tasmaniski

View Helper for reading data from $_GET, $_POST and Routes in view

  Sources   Download

The Requires

 

by Aleksandar Varnicic

helper zf2 view params