Eccube\Repository\PageLayoutRepository::getReadTemplateFile PHP Method

getReadTemplateFile() public method

1. template_realdir app/template/{template_code} 2. template_default_readldir src/Eccube/Resource/template/default
public getReadTemplateFile ( string $fileName, boolean $isUser = false ) : array
$fileName string
$isUser boolean
return array
    public function getReadTemplateFile($fileName, $isUser = false)
    {
        if ($isUser) {
            $readPaths = array($this->app['config']['user_data_realdir']);
        } else {
            $readPaths = array($this->app['config']['template_realdir'], $this->app['config']['template_default_realdir']);
        }
        foreach ($readPaths as $readPath) {
            $filePath = $readPath . '/' . $fileName . '.twig';
            $fs = new Filesystem();
            if ($fs->exists($filePath)) {
                return array('file_name' => $fileName, 'tpl_data' => file_get_contents($filePath));
            }
        }
    }