Loads formulae from a resource.
Formulae should be loaded the same regardless of the current debug mode. Debug considerations should happen downstream.
ResourceInterface $resource A resource:
array An array of formulae
Overrides FormulaLoaderInterface::load
public function load(ResourceInterface $resource) {
try {
$tokens = $this->twig
->tokenize($resource
->getContent(), (string) $resource);
$nodes = $this->twig
->parse($tokens);
} catch (\Exception $e) {
return array();
}
return $this
->loadNode($nodes);
}