/** * Get the list of path templates * * This method will qualify relative url's (url not starting with '/') by prepending the component base * path to the url. If the component has additional paths a template path for each will be inserted in * FIFO order. * * @param string $url The language url * @return array The path templates */ public function getPathTemplates($url) { $templates = parent::getPathTemplates($url); foreach ($templates as $key => $template) { //Qualify relative path if (substr($template, 0, 1) !== '/') { $bootstrapper = $this->getObject('object.bootstrapper'); unset($templates[$key]); $info = $this->parseUrl($url); $paths = $bootstrapper->getComponentPaths($info['package'], $info['domain']); $inserts = array(); foreach ($paths as $path) { $inserts[] = $path . '/' . $template; } //Insert the paths at the right position in the array array_splice($templates, $key, 0, $inserts); } } return $templates; }
/** * Initializes the options for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param ObjectConfig $config An optional ObjectConfig object with configuration options. * @return void */ protected function _initialize(ObjectConfig $config) { $config->append(array('path_templates' => array('<Package>/<Path>/<File>.<Format>'))); parent::_initialize($config); }