Skip to content

Instantly share code, notes, and snippets.

@cmillr
Created May 1, 2012 01:56
Show Gist options
  • Save cmillr/2564379 to your computer and use it in GitHub Desktop.
Save cmillr/2564379 to your computer and use it in GitHub Desktop.
Use Composer-Installed twig with FuelPHP
<?php
// Assuming composer's configured 'vendor' directory is APPPATH/vendor/, this configuration
// file will tell fuel's parser library where to find the twig resource files.
// Place this file inside your APPPATH/config directory.
return array(
'View_Twig' => array(
'include' => APPPATH.'vendor'.DS.'twig'.DS.'twig'.DS.'lib'.DS.'Twig'.DS.'Autoloader.php',
) ,
);
@alrik11es
Copy link

Other point is to just edit the fuel/packages/parser/config/parser.php file.

@cmillr
Copy link
Author

cmillr commented Jan 3, 2014

The problem with that is the fuel/packages/* items are under source control from the central repo and (unless you maintain your own fork of the parser) editing these files will make your local installation diverge from fuel's. This will in turn make it more difficult to keep your fuel installation up to date.

The generally-accepted practice with fuel is to never edit any files outside your APPPATH/ directory, for this reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment