定制 austp/smarty-slim-view 二次开发

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

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

austp/smarty-slim-view

最新稳定版本:1.0.0

Composer 安装命令:

composer require austp/smarty-slim-view

包简介

View that allows you to use Smarty with Slim

README 文档

README

View that allows you to use Smarty with Slim

Installation

composer require austp/smarty-slim-view

As a note, you will still need to require Slim and Smarty yourself. This view just integrates the two.

Configuration

You need to define your template, compile, and cache directories upon initializing the View. You can also optionally define a plugin directory.

public function __construct($template_dir, $compile_dir, $cache_dir, $plugin_dir = '');

Use

<?php

require('vendor/autoload.php');

$app = new \Slim\Slim([
    'view' => new \Slim\View\Smarty(
        __DIR__ . '/templates',
        __DIR__ . '/templates/compile',
        __DIR__ . '/templates/cache
    );
]);

$app->get('/', function () use ($app) {
    $view = $app->view();
    $view->assign('title', 'Hello World');
    
    $view->display('base.tpl');
});

$app->run();

统计信息

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

GitHub 信息

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

其他信息

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