Path to plugin class from a Twig_Node In my custom Twig tag I am trying to reference a class in the Twig_Node compile method, however I receive an error every time stating it can't find it.  What would the path be to a custom plugin class for the Twig_Node?


  Fatal error: Class 'PluginCustomClass' not found in /Volumes/Grid/Devbox/www/event.craft.dev/craft/app/vendor/twig/twig/lib/Twig/Environment.php(403) : eval()'d code on line 431


public function compile(\Twig_Compiler $compiler)
    {
        $compiler
            -&gt;addDebugInfo($this)
            -&gt;subcompile($this-&gt;getNode('pluginTarget'))
            -&gt;raw(', ')
            -&gt;subcompile($this-&gt;getNode('elementsTarget'))
            -&gt;raw(') = new \PluginCustomClass(')
            -&gt;subcompile($this-&gt;getNode('criteria'))
            -&gt;raw(");\n");
    }
Assuming PluginCustomClass is a class inside of a Craft plugin, then the issue is probably that you need to reference it in the Craft namespace.  Something like this should work:

-&gt;raw(') = new \Craft\PluginCustomClass(')


Depending on what type of class that is (Service, Variable, Helper, standalone, etc.), Craft might not have auto-loaded it, so you might need to manually require it as well.