slaxweb/ci-viewloader 问题修复 & 功能扩展

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

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

slaxweb/ci-viewloader

Composer 安装命令:

composer require slaxweb/ci-viewloader

包简介

View Loader for CodeIgniter

README 文档

README

View Loader for CodeIgniter helps to load the view, and inject language strings into the view.

How to use

Initiate the object

If installed with composer, include the autoloader and initiate the object, with the CodeIgniter object passed in. Since views should be loaded only in the controller, it is safe to pass $this

$viewLoader = new \SlaxWeb\ViewLoader\Load($this);

Load the view

To load the view

$viewLoader->loadView("view/file")

Include header/footer

If you want to include a header and footer view, those must be set before

$viewLoader->setHeaderView("header/file");
$viewLoader->setFooterView("footer/file");
$viewLoader->loadView("view/file", $dataArray);

Exclude header/footer

Of course you can set both, or either of them. If you have loaded the header and view, but you want to exclude them for the view that you want to load, pass false, as the third parameter in loadView

$viewLoader->loadView("view/file", $dataArray, false);

Language strings

View loader provides a possibility to pass your language strings into the view. But so you don't pass all of them, it is limited by prefixes in the key of the language array.

$this->lang->load("languageFile");
$viewLoader->setLanguageStrings("prefix_");
$viewLoader->loadView("view/file", $dataArray);

This takes all the language strings which have their keys prefixed with "prefix_" and injects them into the view data to be used as regular variables. So $lang["prefix_myString"] becomes $myString in the view.

ChangeLog

1.0.0

Initial version

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPLv3
  • 更新时间: 2014-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固