t4web/ze-prototype

Zend-Expressive 中间件。原型工具 - 用于快速简单地创建静态HTML页面

dev-master 2016-02-09 08:39 UTC

This package is auto-updated.

Last update: 2024-08-26 17:06:22 UTC


README

Zend-Expressive 中间件。原型工具 - 用于快速简单地创建静态HTML页面

只需将原型模块添加到您的应用程序中,如此处所示。然后,请确保您为页面创建一个模板。在上面的示例中,我可能会在templates/app/prototype/about.phtml中创建文件。

之后,您可以访问页面 http://your.host/proto?t=about

  • http://your.host/proto?t=about/first - 将显示模板 templates/app/prototype/about/first.phtml
  • http://your.host/proto?t=about/second - 将显示模板 templates/app/prototype/about/second.phtml
  • http://your.host/proto?t=about/second&l=layout/empty - 将显示模板 templates/app/prototype/about/second.phtml 和布局 templates/layout/empty.phtml

配置

您可以为应用程序覆盖配置。在 config/autoload/templates.global.php 中,只需添加 protoproto-layout 命名空间

'templates' => [
    // ...
    'paths' => [
        // ...
        'proto'  => ['templates/app/proto'],
        'proto-layout'  => ['templates/app/proto/layout'],
    ],
],

并在 templates/app/ 中创建 proto 文件夹。