承接 volta-framework/component-template 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

volta-framework/component-template

最新稳定版本:v1.0.0

Composer 安装命令:

composer require volta-framework/component-template

包简介

A HTML - PHP template module based on the PHP build in template engine.

README 文档

README

An HTML - PHP template module based on the PHP build in template engine.

%%{init: {'theme':'dark'}}%%
classDiagram
    class Volta_Component_Templates_Exception
    Exception<|--Volta_Component_Templates_Exception
    class Exception
    class Stringable {
         	&lt;&lt;interface&gt;&gt;
    }
    class Throwable {
         	&lt;&lt;interface&gt;&gt;
    }
    StringAble..|>Throwable
    Throwable..|>Exception
    class Volta_Component_Templates_NotFoundException
    Volta_Component_Templates_Exception<|--Volta_Component_Templates_NotFoundException
    class Volta_Component_Templates_Template {        
    }
   
   
  
    class Volta_Component_Templates_TemplateInterface {
         	&lt;&lt;interface&gt;&gt;       
    }
   
    Volta_Component_Templates_TemplateInterface..|>Volta_Component_Templates_Template
    class ArrayAccess {
         	&lt;&lt;interface&gt;&gt;
    }
    ArrayAccess..|>Volta_Component_Templates_Template
    Stringable..|>Volta_Component_Templates_Template
    class Volta_Component_Templates_View {
      
    }
    Volta_Component_Templates_Template<|--Volta_Component_Templates_View
Loading

Usage

use Volta\Component\Templates\Template as View

// Set the Base Directory globally
// Note: In Volta all directory references ends with a slash
View::setBaseDir('/path/to/templates/directory/');

// Create a view with basic placeholders
$view = new View('layout.html.php', [
    'title' => 'Unknown page'
]);

// add placeholders using the set function
$view->set('description', 'A simple home page')

// or use array access
$view['keywords'] = 'home, simple';

// add the template for the content and overwrite some off the parents
// placeholders
$view->addSubTemplate('content', 'content.html.php', ['title' => 'Contact'])

// render the view
echo $view;

layout.html.php

<?php ?>
<!DOCTYPE html>
<html>
<head>
    <title><?= $this->get('title', 'No Title'); ?></title>
    <link rel="stylesheet" href="/assets/css/main.css">
</head>
<body>
    <h1><?= $this['title']; ?></h1>
    <?= $this->getSubTemplate('content'); ?>
</body>
</html>

content.html.php

<?php ?>
<h2><?= $this['title']; ?></h2>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固