stefanotorresi / my-pages
此软件包已被废弃且不再维护。没有推荐替代软件包。
这是一个由Matthew Weier O'Phinney编写的Zend Framework网站PageController模块的粗劣仿制品。所有荣誉都归他所有。
0.1.1
2014-02-24 12:55 UTC
Requires
- php: >=5.4.1
- stefanotorresi/my-base: 1.*
- zendframework/zendframework: 2.*
Suggests
- phly/phly-simple-page: A more comprehensive module than MyPage
This package is auto-updated.
Last update: 2022-02-01 12:26:24 UTC
README
MyPages是一个非常简单的Zend Framework 2模块,提供了一个基本的Controller,可以从路由解析视图模板。
用法
- 将视图模板放入已注册为
template_path_stack
的路径下的pages
子目录中。 - 添加您的路由,指定
MyPages\PageController
为控制器,将模板名称作为page
参数
// somewhere in your router config 'static-page-route' => [ 'type' => 'literal', 'options' => [ 'route' => '/static-page' 'defaults' => [ 'controller' => 'MyPages\PageController', 'page' => 'static-page-template', ], ], ]
当路由匹配/static-page
时,这将渲染第一个解析的pages/static-page-template
视图。当然,您可以使用任何其他对您有效的解析配置。
您可以更改的两个设置
// somewhere in your autoloaded configs 'MyPages' => [ 'route_param_name' => 'page', 'template_dir' => 'pages', ],
荣誉
该模块仅是Zend Framework网站PageController模块的粗劣仿制品,由Matthew Weier O'Phinney编写。所有荣誉都归他所有。
要获取一个具有缓存等功能的更完整的模块,请查看Matthew Weier O'Phinney的PhlySimplePage模块。