phile/content-variables 问题修复 & 功能扩展

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

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

phile/content-variables

Composer 安装命令:

composer require phile/content-variables

包简介

A plugin to add custom variables in your content before it is parsed.

README 文档

README

A plugin for Phile to add custom variables in your content before it is parsed.

1.1 Installation (composer)

composer require phile/content-variables

1.2 Installation (Download)

  • Install the latest version of Phile
  • Clone this repo into plugins/phile/contentVariables

2. Activation

After you have installed the plugin. You need to add the following line to your config.php file:

$config['plugins']['phile\\contentVariables'] = array('active' => true);

Usage

You must have a variables array in your config.

$config['variables'] = array(
  'site_title' => $config['site_title'],
  'base_url' => 'https://example.com/
);

These keys are the variables, and the value is what the replaced string will be. So now when you reference %base_url% in your markdown/textile/content pages, it will be rendered as your real base URL:

This is a link to my [base URL](%base_url%)

Will be rendered as:

<p>This is a link to my <a href="https://example.com">base URL</a></p>

Another example for a site with the title PhileCMS:

Welcome to %site_title%!

Becomes:

<p>Welcome to PhileCMS!</p>

Config

This plugin allows the open and close tags for your variables to be set. By default they are both set to the following:

'open_tag' => '%', // the open tag for the variable
'close_tag' => '%' // the close tag for the variable

This means any text wrapped with % signs will be replaced.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-04-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固