0
votes

I am trying to set up Twig Templating Engine with my new Codeigniter project.

But I am getting this error after setting up

Twig Exception

    There are no registered paths for namespace "__main__".

I don't know what this error means. and how to solve it.

As per I am checking this is originated from the following file-

/application/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:

code:

    class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface, Twig_SourceContextLoaderInterface
    {
        /** Identifier of the main namespace. */
        const MAIN_NAMESPACE = '__main__';

        protected $paths = array();
        protected $cache = array();
        protected $errorCache = array();

        private $rootPath;

        ...

I followed this article for setting up

https://github.com/bcit-ci/CodeIgniter/wiki/Twig-PHP-Template-Engine-Implementation

Codeigniter Version- 3.1.8

1

1 Answers

0
votes

Finally I made it.

I was missing this entry in autoload.php file

$autoload['config'] = array('twig');