定制 idealogica/good-view 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

idealogica/good-view

最新稳定版本:1.0.4

Composer 安装命令:

composer require idealogica/good-view

包简介

Extremely simple and standard compliant view implementation of MVC pattern

README 文档

README

1. What is GoodView?

It is a simple MVC view implementation. By default GoodView uses PHP as template engine but it can be adapted to use any. It supports PSR-7 stream rendering so it can be easily used in HTTP middleware. GoodView supports nested views and layout views.

2. Installation

composer require idealogica/good-view:~1.0.0

3. Basic example

$viewFactory = ViewFactory::createStreamViewFactory(
    new StreamFactory(),
    ['content' => '<div>'],
    [__DIR__ . '/templates']
);
$view = $viewFactory->create('test');
$stream = $view->render(); // StreamInterface instance
$contents = $stream->getContents(); // rendered string

templates/test.phtml:

<?php $this->setLayout('layout') ?>
<?= $this->e($content); ?>

templates/layout.phtml:

!<?= trim($content) ?>!

4. License

GoodView is licensed under a MIT License.

统计信息

  • 总下载量: 766
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-05