承接 wepesi/view 相关项目开发

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

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

wepesi/view

最新稳定版本:v1.1

Composer 安装命令:

composer require wepesi/view

包简介

simple view engine to share data acros a pages

README 文档

README

Simple view engine, and share data across pages

Introduction

Create directory where all the view file will loaded. eg: views the class has few method to be used in order to make your view work as expected.

  • assign : help assign a value to the variable. It has two parameters, the first is the name of the variable and the second parameter is the value of the variable.
  • render : helps display the contents of your file. Is like a parameter, and it's the name of the file. Note: All files must be defined in the root directory of the view.
  • setLayout : help set the layout of the pages.

Installation

composer require wepesi/view

Usage

Without layout

$view_dir = __DIR__."/views";
$view = new \Wepesi\App\View($view_dir);
$view->assign("title","Welcom to the main pages");

$view->render("/art");

With layout

In case you are want to set the layout, you should define the $contentpages variable into your layout file where the view content will be applyed.

$view_dir = __DIR__."/views";
$view = new \Wepesi\App\View($view_dir);
$view->assign("title","Home page");

view->setLayout("/layout");
$view->render("/home");

No need to specify the extension in case it is a php file.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: apache-2.0
  • 更新时间: 2022-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固