Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanotorresi/mypages
MyPages is a very simple Zend Framework 2 module, providing a basic Controller that resolves view templates from routes
https://github.com/stefanotorresi/mypages
Last synced: 18 days ago
JSON representation
MyPages is a very simple Zend Framework 2 module, providing a basic Controller that resolves view templates from routes
- Host: GitHub
- URL: https://github.com/stefanotorresi/mypages
- Owner: stefanotorresi
- License: mit
- Created: 2013-07-26T17:29:40.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-24T17:57:28.000Z (over 10 years ago)
- Last Synced: 2024-10-03T16:23:56.763Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
MyPages
===
[![Latest Stable Version](https://poser.pugx.org/stefanotorresi/my-pages/v/stable.png)](https://packagist.org/packages/stefanotorresi/my-pages)
[![Latest Unstable Version](https://poser.pugx.org/stefanotorresi/my-pages/v/unstable.png)](https://packagist.org/packages/stefanotorresi/my-pages)
[![Build Status](https://travis-ci.org/stefanotorresi/MyPages.png?branch=master)](https://travis-ci.org/stefanotorresi/MyPages)
[![Code Coverage](https://scrutinizer-ci.com/g/stefanotorresi/MyPages/badges/coverage.png?s=79baa286714a1b66bf26fae10608d4ef1dc76b73)](https://scrutinizer-ci.com/g/stefanotorresi/MyPages/)
[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/stefanotorresi/MyPages/badges/quality-score.png?s=f16ed69ccbfc741b6fc09d2637acf01b5b423d19)](https://scrutinizer-ci.com/g/stefanotorresi/MyPages/)MyPages is a very simple Zend Framework 2 module, providing a basic Controller that resolves view templates from the route.
Usage
---1. Put your view templates inside the `pages` sub directory of a path registered as a `template_path_stack` with the [`ViewManager`](http://framework.zend.com/manual/2.2/en/modules/zend.view.quick-start.html#configuration).
2. Add your routes specifying `MyPages\PageController` as the controller and the template name as the `page` param:
```php
// somewhere in your router config
'static-page-route' => [
'type' => 'literal',
'options' => [
'route' => '/static-page'
'defaults' => [
'controller' => 'MyPages\PageController',
'page' => 'static-page-template',
],
],
]
```
this will render the first resolved `pages/static-page-template` view when the route matches `/static-page`.
Of course, you can use any other resolver config that works for you.There are two settings you can change:
```php
// somewhere in your autoloaded configs
'MyPages' => [
'route_param_name' => 'page',
'template_dir' => 'pages',
],
```Credits
---The module is just a brutal rip-off of the [Zend Framework web site PageController] module,
written by [Matthew Weier O'Phinney]. All credits go to him.For a more complete module with functionalities like caching, check out [Matthew Weier O'Phinney]'s [PhlySimplePage module].
[Zend Framework web site PageController]: //github.com/zendframework/zf-web/tree/master/module/PageController
[Matthew Weier O'Phinney]: http://mwop.net
[PhlySimplePage module]: //github.com/weierophinney/PhlySimplePage/