stefanotorresi/my-pages

此软件包已被废弃且不再维护。没有推荐替代软件包。

这是一个由Matthew Weier O'Phinney编写的Zend Framework网站PageController模块的粗劣仿制品。所有荣誉都归他所有。

0.1.1 2014-02-24 12:55 UTC

This package is auto-updated.

Last update: 2022-02-01 12:26:24 UTC


README

Latest Stable Version Latest Unstable Version Build Status Code Coverage Scrutinizer Quality Score

MyPages是一个非常简单的Zend Framework 2模块,提供了一个基本的Controller,可以从路由解析视图模板。

用法

  1. 将视图模板放入已注册为template_path_stack的路径下的pages子目录中。
  2. 添加您的路由,指定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'PhinneyPhlySimplePage模块