承接 lin3s/template-selector 相关项目开发

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

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

lin3s/template-selector

Composer 安装命令:

composer require lin3s/template-selector

包简介

Adds a field to declare templates used by pages dynamically

README 文档

README

Adds a field to declare templates used by pages dynamically

Scrutinizer Code Quality Total Downloads      Latest Stable Version Latest Unstable Version

DEPRECATED: included in WPFoundation 1.6.0

This feature is included by default in WPFoundation since version 1.6.0. You just need to extend the abstract class LIN3S\WPFoundation\Configuration\Theme\Theme to get it working.

Why?

LIN3S's WPRouting is a very robust solution to manage the Wordpress routing system in a Symfony way. We came up with this solution in our way to a MVC architecture because many PHP files where scattered in our template root directory with dummy unstructured code.

This way, we are now able to match routes used by Wordpress with the actions from our Controllers, letting us to keep a simpler a more intuitive theme folder structure for new coming developers.

We faced some issues when we started using WP-Routing plugin, creating a php file in theme's root folder had no sense just to add an annotation. Therefore, we came up with this alternative to avoid using annotations to declare new page templates.

With this plugin you can now use a hook to add your custom page templates, and the default template selector items will be replaced with your programatically declared templates.

Installation

The recommended and the most suitable way to install is through Composer. Be sure that the tool is installed in your system and execute the following command:

$ composer require lin3s/template-selector

Remember that Template Selector is a Wordpress plugin so, they can customize the location path easily with Composer (more info):

"extra": {
    "installer-paths": {
        "src/plugins/{$name}/": ["type:wordpress-plugin"],
        "src/themes/{$name}/": ["type:wordpress-theme"],
        "src/mu-plugins/{$name}/": ["type:wordpress-muplugin"]
    }
}

Usage

To declare the templates just add the following hook to your WordPress theme.

add_filter('template_selector_available', [$this, 'templates']);

public function templates($templates) {
    return array_merge($templates, [
        'template-slug'    => 'Template name shown in admin',
        'another-template' => 'Another template'
    ]);
}

Licensing Options

License

lin3s/template-selector 适用场景与选型建议

lin3s/template-selector 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.97k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 07 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「lin3s」 「wp-plugin」 「template-selector」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 lin3s/template-selector 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lin3s/template-selector 我们能提供哪些服务?
定制开发 / 二次开发

基于 lin3s/template-selector 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 17
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-30