I want to use a css parser that uses namespaces. I put the files in the providers and application by importing them. but the script itself does not find its classes
At the top of my class, I import the file:
App::import('Vendor', 'Sabberworm', array('file' => 'Sabberworm/CSS/Parser.php'));
which is located in / root / vendors / Sabberworm / CSS / (all files are in this namespace)
Inside the class method, I create a new instance:
public function parse($content) { $oParser = new Sabberworm\CSS\Parser($content); ... }
So far so good. But if now I want to call $oCss = $oParser->parse(); fatal errors:
"Fatal error: Class 'Sabberworm\CSS\CSSList\Document'"
it does not work because it needs other files (which must be loaded using namespaces). the root providers folder is in the include path, and the external script appears to set the namespace to "Sabberworm \ CSS namespace;". What am I missing? I am new to namespaces.
source share