figdice/slim-view 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

figdice/slim-view

Composer 安装命令:

composer require figdice/slim-view

包简介

Slim Framework 3 view helper built on top of the FigDice templating component

README 文档

README

Slim Framework 3 Delegate for FigDice View

Container (DI) View component for the Slim Framework 3, that wires FigDice Templating library into Slim.

Read Slim Views Documentation for more details.

Installation

In composer.json:

"require": {
  "figdice/slim-view": "*"
}

Usage

1. Register FigDice SlimView component in Slim container

// Create container
$container = new \Slim\Container;

// Register component on container
$container['view'] = function ($c) {
  $slimview = new \figdice\slim\SlimView('path/to/templates');
  
  // Optionally configure FigDice View settings
  // (cache directory, dictionaries, feed & function factories, etc.)
  $slimview->getView()->setTempPath('path/to/cache');
  $slimview->getView()->registerFeedFactory( new MyFeedFactory(...) );
  // ...
  
  return $slimview;
};

2. Render FigDice templates in Slim routes

// Create app
$app = new \Slim\App($container);

// Render FigDice template in route
$app->get('/hello/{name}', function ($request, $response, $args) {
    return $this->view->render($response, 'profile.html', [
        'name' => $args['name']
    ]);
});

// Run app
$app->run();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-12