2017 © Pedro Peláez
 

library jmlzf-helpers

A collection of ZF2 helpers

image

jmleroux/jmlzf-helpers

A collection of ZF2 helpers

  • Thursday, November 14, 2013
  • by jmleroux
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

jmlzf-helpers

A collection of helpers for Zend Framework 2, (*1)

Latest Stable Version Build Status Coverage Status, (*2)

CurrentRoute

This helper gives access to the matched route in the view. Useful for adding query params for example., (*3)

Usage
<?php echo $this->currentRoute(); ?>

QueryParams

This helper provides access to the query parameters as an associative array., (*4)

Usage
queryParams(); ?>


Sortable

This helper add or replace query parameters for sorting purpose., (*5)

Usage


// table cells
ID Label

Ouput :, (*6)

<table>
  <thead>
    <th>
      <a href="http://example.com/?sort=id&direction=asc">ID</a>
    </th>
    <th>
      <a href="http://example.com/?sort=label&direction=asc">Label</a>
    </th>
  </thead>
  <tbody>
  // table cells
  </tbody>
</table>

If you click on the ID column, the next output will be, (*7)

<table>
  <thead>
    <th>
      <a href="http://example.com/?sort=id&direction=desc">ID</a>
    </th>
    <th>
      <a href="http://example.com/?sort=label&direction=asc">Label</a>
    </th>
  </thead>
  <tbody>
  // table cells
  </tbody>
</table>

Maybe i'll wrap this one in another helper to be able to generate a class for the th element., (*8)

The Versions