2017 © Pedro Peláez
 

library code-example-plugin

Code Example Plugin for Tapestry

image

tapestry-cloud/code-example-plugin

Code Example Plugin for Tapestry

  • Thursday, May 18, 2017
  • by carbontwelve
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 11 % Grown

The README.md

Tapetry Asset Plugin

Packagist Minimum PHP Version Software License Gitmoji ghit.me, (*1)

Install

To install run: composer require tapestry-cloud/code-example-plugin, (*2)

Next you need to update your site configuration to include the path to your code examples folder:, (*3)

// ...

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

// ...

Finally within your site Kernel.php you need to register the plugin's service provider:, (*4)

<?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., (*5)

The Versions

18/05 2017

dev-master

9999999-dev

Code Example Plugin for Tapestry

  Sources   Download

MIT

17/05 2017

1.0.0

1.0.0.0

Code Example Plugin for Tapestry

  Sources   Download

MIT