Twig integration in CI4 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: Twig integration in CI4 (/showthread.php?tid=76656) |
RE: Twig integration in CI4 - kenjis - 04-14-2023 (04-14-2023, 02:43 AM)foxbille Wrote: But then, using twig, the flow is still not good, code of default_full.twig is displayed as if htmlentities() was used Try raw: https://twig.symfony.com/doc/3.x/filters/raw.html RE: Twig integration in CI4 - foxbille - 04-17-2023 (04-14-2023, 03:26 AM)kenjis Wrote:(04-14-2023, 02:43 AM)foxbille Wrote: But then, using twig, the flow is still not good, code of default_full.twig is displayed as if htmlentities() was used Hi, Thanks, but doesn't work either. [code] </form> </div> {% pager.setSurroundCount(2) %} <div class="linklist-paging"> <div class="paging pure-g"> <div class="linklist-pages pure-u-1-3"> {% if pager.hasPrevious() %} <a href="{{pager.getFirst()}}" aria-label="{{ lang('Pager.first') }}"> <span aria-hidden="true"> <i class="fa fa-angle-double-left px-2"></i></span> [/php] RE: Twig integration in CI4 - filipussetio - 04-27-2023 [quote pid="407923" dateline="1679299816"] Hi @kenjis So i've integrated my Twig on CI4 with your Twig but i got this error. Unknown "form_error" function. did i miss something on the installation or do i have to modify something to use form_error function? Thanks! [/quote] RE: Twig integration in CI4 - foxbille - 08-23-2023 Hi All, Have the same problem : an Add form worked well until i add PHP Code: {{ form_error('lastname') }} Twig\Error\SyntaxError Unknown "form_error" function. RE: Twig integration in CI4 - ozornick - 08-23-2023 You paste code helper('form') in controller? RE: Twig integration in CI4 - foxbille - 08-23-2023 Thanks for replay I might not have understand your question anyway, here is my code In controller PHP Code: use \Kenjis\CI4Twig\Twig; PHP Code: {% extends "default.twig" %} RE: Twig integration in CI4 - ozornick - 08-23-2023 Fixed? public function add() { helper('form'); .... } RE: Twig integration in CI4 - foxbille - 08-24-2023 (08-23-2023, 09:56 AM)ozornick Wrote: Fixed? nope RE: Twig integration in CI4 - kenjis - 08-24-2023 Try to load the helper before `$this->twig = new Twig(['functions' => ['dateSlash']]);` RE: Twig integration in CI4 - foxbille - 09-02-2023 (08-24-2023, 05:05 PM)kenjis Wrote: Try to load the helper before `$this->twig = new Twig(['functions' => ['dateSlash']]);` Does not fix. but I might say that helper is yet loaded in baseController.php PHP Code: protected $helpers = ['form', 'date', 'iti']; |