/** * Retrieve the template and partials list associated to the application. * * @internal ysfDimensionsPlugin support, modifications have to be done here. */ protected function processTemplates() { $layouts = array(); $partials = array(); $templates_dir = $this->getPath() . DIRECTORY_SEPARATOR . $this->getName() . DIRECTORY_SEPARATOR . 'templates'; // Get 1st level -> layout ///////////////////////////////////////////////// $results = sfFinder::type('file')->maxdepth(0)->in($templates_dir); $layouts = array(); foreach ($results as $filePath) { $matches = null; preg_match(paProject::$regexps['ENDING_FILENAME'], $filePath, $matches); $infos = explode('_', sfInflector::underscore($matches[1])); // Does not start by _ => layout if (!empty($infos[0])) { $object = new paSfLayout($this, $matches[1]); $layouts[] = $object; } else { $object = new paSfPartial($this, $matches[1]); $partials[] = $object; } // Compute file length $file_content = file_get_contents($filePath); // Keep the file name in the object ?? $object->setCodeLength(empty($file_content) ? 0 : count(explode("\n", $file_content))); } // Get 2nd level partials ////////////////////////////////////////////////// $resultsLevel2 = sfFinder::type('file')->maxdepth(1)->in($templates_dir); // Remove 1st level $resultsLevel2 = array_diff($resultsLevel2, $results); // Modifiy here for support foreach ($resultsLevel2 as $filePath) { $matches = null; preg_match(paProject::$regexps['ENDING_FILENAME'], $filePath, $matches); $object = new paSfPartial($this, $matches[1]); $file_content = file_get_contents($filePath); $object->setCodeLength(empty($file_content) ? 0 : count(explode("\n", $file_content))); $partials[] = $object; } $this->layouts = $layouts; $this->partials = $partials; }
/** * For debug purpose. */ public function __toString() { return parent::__toString() . ', actionStatus=' . $this->actionStatus; }