tatter/layouts
Composer 安装命令:
composer require tatter/layouts
包简介
Layout management service for CodeIgniter 4
README 文档
README
Layout management service for CodeIgniter 4
Description
This library provides a commons means of managing View Layouts across package modules and applications.
Installation
Install easily via Composer to take advantage of CodeIgniter 4's autoloading capabilities and always be up-to-date:
> composer require tatter/layouts
Or, install manually by downloading the source files and adding the directory to
app/Config/Autoload.php.
Configuration
The code of Layouts amounts to a single config file: Tatter\Layouts\Config\Layouts. This
file provides the path for each layout as a property. Initially the config file only
includes a single property: "default". By supplying your own path via an App config file
you can direct any package or module using Layouts to use your layout instead. For example,
app/Config/Layouts.php:
<?php namespace \Config; class Layouts extends \Tatter\Layouts\Config\Layouts { public $default = 'App\Views\project_layout'; }
Usage
To use the configured layout, simply provide the config property to your view file:
<?= $this->extend(config('Layouts')->default) ?> <?= $this->section('main') ?> <p>Hellow world!</p> <?= $this->endSection() ?>
You can use any layout name you have configured, and any name that does not match will fall back on the path supplied for "default".
See the CodeIgniter User Guide to read more on View Layouts
Layout Expectations
For consistency this library assumes that the "default" template will have the following sections:
- headerAssets: The last section prior to the closing
</head>tag, available for adding CSS tags and the like. - navbar: A navigation menu, typically to be displayed along the top of the page.
- main: The main content for the page (can include nested views, etc).
- footerASsets: The last section prior to the closing
</body>tag, available for adding JS tags and footer content.
Default Layout
While it is highly recommended that you supply your own "default" layout, this library includes
a generic one as a fallback. This layout is based on the Bootstrap Starter Template
and includes CDN tags for Bootstrap CSS and JS. In addition to fulfilling the expectations above,
the layout also accepts the following variables to configure the HTML <head> data:
- $headerDescription
- $headerAuthor
- $headerTitle
tatter/layouts 适用场景与选型建议
tatter/layouts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 45.95k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2021 年 12 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「codeigniter」 「layouts」 「frontend」 「codeigniter4」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tatter/layouts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tatter/layouts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tatter/layouts 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The CodeIgniter Redis package
Kirby Layouts
Query filtering in your frontend
Article CSS-ID Frontend Output Optimization
Frontend support for the MultiColumnWizard
统计信息
- 总下载量: 45.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 24
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-13