承接 minii-php/minii 相关项目开发

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

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

minii-php/minii

Composer 安装命令:

composer require minii-php/minii

包简介

Minii, a simple template engine for PHP!

README 文档

README

Minii, is a simple template engine for PHP!

Install

You can install it using Composer.

composer require minii-php/minii

Config

First you need create the config.

$config = [

    'views' => 'app/views',
    'includes' => 'app/views/components',
    'globals' => [
        'root' => 'http://localhost:8000/'
    ]
];
  • views : Is the location of the views.
  • includes : Is the location of the includes.
  • globals : Is the global variables.

Use

// $... = new Minii\View( [ Config ] );
$minii = new Minii\View($config);

// $...->render( View , [ Variables ] );
echo $minii->render('home',['name'=>'Minii']);

Render

The Minii use HTML files:

Load Includes

You may load includes out of the view.

app/views/components/header.html

// $...->load( Include , [ Variables ] );
$header = $minii->load('header',['name'=>'Minii']);

Delimiters

  • {{ $... }} : Use to print a variable.
  • {% ... %} : Use to include a component.

app/views/home.html

{% header %}

<a href="{{ $root }}">
    <h1>{{ $name }}</h1>
</a>

{% footer %}

You can use the variables in includes:

app/views/components/header.html

// header include

<header>
    <a href="{{ $root }}">
        <span>{{ $name }}</span>
    </a>
<header>

Control Structures

If Statements

You may construct if statements using the @if, @elif, @else, and @endif directives.

@if( $num == 1 )

    $num is equal to 1

@elif( $num > 1)

    $num is greater than 1

@else

    $num is less than 1

@endif

Loops

@for ($i = 0; $i < 10; $i++)

    The current value is {{ $i }}

@endfor

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固