承接 uniqby/yii2-smart-layout 相关项目开发

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

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

uniqby/yii2-smart-layout

最新稳定版本:0.3

Composer 安装命令:

composer require uniqby/yii2-smart-layout

包简介

Smart Layout behavior for Yii framework 2.

README 文档

README

Yii2 Smart Layout behavior makes the theming of your application so simple

Installation

Composer

The preferred way to install this extension is through Composer.

Either run

php composer.phar require uniqby/yii2-smart-layout "dev-master"

or add

"uniqby/yii2-smart-layout": "dev-master"

to the require section of your composer.json

Usage

Configure Smart Layout behavior in common config:

'view' => [
	'as smartLayout' => [
    	'class' => \uniqby\smartLayout\Behavior::className(),
	]
]

Info

Component searches for the layout file relative to the current theme, module, controller and action.

$pathMaps = $controller->view->theme->pathMap;
if (is_array($pathMaps) && !empty($pathMaps)) {
	foreach ($pathMaps as $path) {
		if ($moduleId !== null) {
			$layouts[] = "{$path}/{$moduleId}/layouts/{$controllerId}_{$actionId}";
			$layouts[] = "{$path}/{$moduleId}/layouts/{$controllerId}";
			$layouts[] = "{$path}/{$moduleId}/layouts/main";
		} else {
			$layouts[] = "{$path}/layouts/{$controllerId}_{$actionId}";
			$layouts[] = "{$path}/layouts/{$controllerId}";
			$layouts[] = "{$path}/layouts/main";
		}
	}
}

Author

Alexander Sazanovich, e-mail: alexander@uniq.by

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2014-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固