定制 tapestry-cloud/code-example-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

tapestry-cloud/code-example-plugin

最新稳定版本:1.0.0

Composer 安装命令:

composer require tapestry-cloud/code-example-plugin

包简介

Code Example Plugin for Tapestry

README 文档

README

Packagist Minimum PHP Version Software License Gitmoji ghit.me

Install

To install run: composer require tapestry-cloud/code-example-plugin

Next you need to update your site configuration to include the path to your code examples folder:

// ...

    'plugins' => [
        'code_example_path' => __DIR__ . '/code_examples/'
    ],

// ...

Finally within your site Kernel.php you need to register the plugin's service provider:

<?php

use Tapestry\Modules\Kernel\KernelInterface;

class Kernel implements KernelInterface
{
    /**
     * @var Tapestry
     */
    private $tapestry;
    
    public function __construct(Tapestry $tapestry)
    {
        $this->tapestry = $tapestry;
    }
    
    /**
     * This method is executed by Tapestry when the Kernel is registered.
     *
     * @return void
     */
    public function register()
    {
        // Use project autoloader
        require_once(__DIR__ . '/vendor/autoload.php');
    }
    
    /**
     * This method of executed by Tapestry as part of the build process.
     *
     * @return void
     */
    public function boot()
    {
        $this->tapestry->register(\TapestryCloud\CodeExample\ServiceProvider::class);
    }
}

Usage

This plugin adds the $this->codeExample('example.php') helper, which will output your code examples with their html entities encoded.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-17