Skip to content

LightCandy: Improve render handlebars template #2

@euphoricMV

Description

@euphoricMV

Problem:

On version with LightCandy library, rendering is done on default PHP way, by creating PHP file, include it and call as a function.

Current solution:

    // Save the compiled PHP code into a php file
    file_put_contents('render.php', '<?php ' . $php . '?>');
    // Get the render function from the php file
    $renderer = include('render.php');
    $results = $renderer($data, ['debug' => Runtime::DEBUG_ERROR_LOG]);

Proposal:

Something like this: https://github.com/jenschude/HandlebarsBundle/blob/develop/src/HandlebarsEnvironment.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions