AMYBundle::getTemplates PHP Method

getTemplates() protected method

protected getTemplates ( )
    protected function getTemplates()
    {
        $templates_path = $this->bundlePath . '/templates/';
        if (!is_dir($templates_path)) {
            return array();
        }
        $templates = array();
        if (false !== ($d = opendir($templates_path))) {
            while (false !== ($f = readdir($d))) {
                if ('.' == $f[0]) {
                    continue;
                }
                $content = file_get_contents($templates_path . '/' . $f);
                $ix = strpos($content, "\n");
                $info = explode(';', substr($content, 0, $ix));
                $content = substr($content, $ix + 1);
                $templates[] = array('filename' => $info[0], 'name' => $info[1], 'content' => $content);
            }
            closedir($d);
        }
        return $templates;
    }