Proposal to Enable Plates Asset Extension

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Proposal to Enable Plates Asset Extension

stormwild
Hi

Requesting feedback for proposal

https://github.com/zendframework/zend-expressive-platesrenderer/issues/3

Proposal to refactor PlatesRendererFactory to enable [asset extension](http://platesphp.com/extensions/asset/).

use League\Plates\Extension as PlatesExtension;

// Create the engine instance:
$engine = new PlatesEngine();

// Enable asset extension
$engine->loadExtension(new PlatesExtension\Asset($config['paths']['assets']));

This will allow plates-layout.phtml in zend-expressive-skeleton to reference assets similar to:


<img src="<?=$this->asset('zf-logo.png')?>" alt="Zend Expressive" />

Where the assets path is configured in templates.global as:

    'templates' => [
        'extension' => 'phtml',
        'paths' => [
            'assets' => 'public',
            'app'    => ['templates/app'],
            'layout' => ['templates/layout'],
            'error'  => ['templates/error'],


--
------------------------------

Alexander R. Torrijos
Web Developer
Mobile: +63 919 991 5653
Res: +63 2 822 7219
Skype/YM: artorrijos

------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Proposal to Enable Plates Asset Extension

Mike Willbanks
Hello Alexander,

On Fri, Dec 11, 2015 at 4:56 AM, Alexander Torrijos <[hidden email]> wrote:

Commented on the github issue.
 

Proposal to refactor PlatesRendererFactory to enable [asset extension](http://platesphp.com/extensions/asset/).

use League\Plates\Extension as PlatesExtension;

// Create the engine instance:
$engine = new PlatesEngine();

// Enable asset extension
$engine->loadExtension(new PlatesExtension\Asset($config['paths']['assets']));

This will allow plates-layout.phtml in zend-expressive-skeleton to reference assets similar to:


<img src="<?=$this->asset('zf-logo.png')?>" alt="Zend Expressive" />

Where the assets path is configured in templates.global as:

    'templates' => [
        'extension' => 'phtml',
        'paths' => [
            'assets' => 'public',
            'app'    => ['templates/app'],
            'layout' => ['templates/layout'],
            'error'  => ['templates/error'],


--
------------------------------

Alexander R. Torrijos
Web Developer
Mobile: <a href="tel:%2B63%20919%20991%205653" value="+639199915653" target="_blank">+63 919 991 5653
Res: <a href="tel:%2B63%202%20822%207219" value="+6328227219" target="_blank">+63 2 822 7219
Skype/YM: artorrijos

------------------------------