kenjis / codeigniter-ss-twig

A Simple and Secure Twig integration for CodeIgniter 3.x and 4.x
MIT License
168 stars 46 forks source link

Create templates in live #29

Closed daycry closed 2 years ago

daycry commented 7 years ago

For example:

$this->twig->create($params->campaign->template_subscription, $data);

on

$params->campaign->template_subscription is a twig template in database

kenjis commented 6 years ago

@daycry Thank you for your PR.

I think the API should be like this:

$template = $this->twig->createTemplate($template_string);
$this->twig->display($template, $data);

I don't accept the method name create() or createTemplate() in your PR. Because the name implies just to create a template, but it does render the template and set output, too.

daycry commented 6 years ago

The name of method would be getStringTemplate or similar.

I think that this is a good function for your twig library, because some templates are in database.

On Sep 17, 2017 11:14 AM, "kenjis" notifications@github.com wrote:

@daycry https://github.com/daycry Thank you for your PR.

I think the API should be like this:

$template = $this->twig->createTemplate($template_string);$this->twig->display($template, $data);

I don't accept the method name create() or createTemplate() in your PR. Because the name implies just to create a template, but it does render the template and set output, too.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kenjis/codeigniter-ss-twig/pull/29#issuecomment-330031288, or mute the thread https://github.com/notifications/unsubscribe-auth/AHPRv6CsTr8WfyRo9gGrHT8-1VVHzwaMks5sjOLkgaJpZM4NAGsC .

kenjis commented 2 years ago

Sorry, I have no plan to add functionality to v1.x (master branch).