• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Twig integration in CI4

During the installation of CI4 using Composer, i was happy to see that i could use Composer to install Twig by running " composer require kint-php/kint-twig". I did this and Twig got installed.

Is that enough? Will the CI4 autoload the Twig library?

Thank you in advance.

Yes, it will find it like any other Composer packages you can install.

No, it is not enough. There should be a bridge to CI4's API, but I don't know whether such thing has been developed yet. If you call Twig directly for example, you would not be able to use CI4's features like locating templates, caching, viewcells.

I managed to install the Twig component using Composer without any problem. The problem is that Twig is not integrated. I could integrated Twig easily with CI3 but honestly dont know how to do it CI4. It is so sad that the documentation for CI4 does not cover the installation of its extensions.

Appreciate any help. Thank you.

@ivantcholakov: If you want that tight of connection, you need to develop that yourself. I don't know of any CI4 Twig Parser library. You can take a look on how our View Parser where built an incorporate twig instead.

@murugappan: You can only use it natively as there are no CI4 package to extend it. If you are using Compopser, you can access those libraries directly ( In this case \Twig ). You don't need to include an files. Composer Support

Please see Twig template for CI4 for more information about the matter.

Hi guys,

I found the integration library for twig in the following link https://github.com/deathart/BlogCI4/blob...g/Twig.php
Awesome. Will test it out. Thank you all.

Stay Safe, Stay Free, Stay United.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.