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

Add functionality to add functions with config #8

Closed kenjis closed 8 years ago

kenjis commented 8 years ago

This PR enables to add user helper functions.

application/config/twig.php

$config['functions'] = ['my_func'];

or

$config = [
    'functions' => ['my_func'],
];
$this->load->library('twig', $config);
kenjis commented 8 years ago

@MJTheOne I changed the config key from functions_asis to just functions.

I was thinking the need for adding user functions. Thank you for your PR. I'll test this PR more, and merge this PR in a some days.