-
Notifications
You must be signed in to change notification settings - Fork 2
Using Twig
Twig is a modern template engine which is fast, secure, flexible and easy to use.
The kitFramework provide you with Twig. This template engine is well documented so there is no need to create a own documentation for Twig.
You can access Twig everywhere in kitFramework with $app['twig'].
The kitFramework extend Twig with some functions (for usage within the templates):
-
is_authenticated()returntrueif the CMS user is authenticated -
user_display_name()return the name of a authenticated CMS user -
template_file()maps$app['utils']->templateFile()(see Using Class Basic)
and inject some constants for the usage in Twig, like:
-
CMS_URL- the URL of the CMS -
THIRDPARTY_URLthe URL to third party extensions
please look at kitFramework Constants for a complete list.
The kitFramework expect that you are using the following scheme for your templates:

In general all extensions should use a Model View Control Pattern, the kitFramework is using Data (Model) - Template (View) - Control (Control).
- Your Template (View) folder must have the name
/Template- otherwise the dynamic assigning of templates will not work for your extension. - The
/Templatemust contain a/defaultfolder, which will be selected if no other template is select.
You will find hints for the usage of Twig in this tutorial and too in the kitFramework, but in general you should use Twig as you like.
In the next step start using the kitCommands for more complex and interactive extensions
- If you spot a typo or want to contribute an article, a how-to or a tip, please feel free to edit the Wiki directly
- If you you have any question or suggestion, please contact the phpManufaktur Support Group
© 2013 by phpManufaktur, kitFramework & kfHelloWorld are published under MIT license.