1 | <?php |
||
23 | class BaseStaticPageController extends Controller |
||
24 | { |
||
25 | /** |
||
26 | * Returns the name of the Bundle, where the templates, which are |
||
27 | * containing the static content, are stored |
||
28 | * |
||
29 | * @return string Name of the Content Bundle |
||
30 | */ |
||
31 | protected function getContentBundleName() |
||
35 | |||
36 | /** |
||
37 | * Returns the name of the folder where the content templates are stored. |
||
38 | * |
||
39 | * This folder has to be located in %YourBundleName%/Resources/views |
||
40 | * The default path is C33s/StaticPageContentBundle/Resources/views/Content |
||
41 | * so the default return value is "Content". |
||
42 | * |
||
43 | * @return string Name of the folder containing the Content |
||
44 | */ |
||
45 | protected function getContentFolderName() |
||
49 | |||
50 | /** |
||
51 | * Should the Static content be sandboxed? |
||
52 | * |
||
53 | * Only works for the default Content Container |
||
54 | * |
||
55 | * http://twig.sensiolabs.org/doc/api.html#sandbox-extension |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | protected function isSandboxed() |
||
63 | |||
64 | /** |
||
65 | * Returns the full template "path" expression for a given content name. |
||
66 | * Currently only twig is implemented. The Expression includes the ":" |
||
67 | * seperators. |
||
68 | * It's not the Filesystem path it's a twig path. |
||
69 | * |
||
70 | * @param string $contentName The name of the content file which should be loaded |
||
71 | * @param boolean $useTranslations Whether to add translation component to file path or not |
||
72 | * |
||
73 | * @return string Full path expression for the template |
||
74 | */ |
||
75 | protected function getContentLocation($contentName, $useTranslations) |
||
87 | |||
88 | /** |
||
89 | * Returns template extension. Default is ".html.twig". |
||
90 | * |
||
91 | * @return string Template Extension (dual extension) like ".html.twig" |
||
92 | */ |
||
93 | protected function getTemplateExtension() |
||
97 | |||
98 | /** |
||
99 | * Returns the full "path" expression for the Container Template |
||
100 | * |
||
101 | * @return string container template "path" expression |
||
102 | */ |
||
103 | protected function getContainerLocation() |
||
107 | |||
108 | /** |
||
109 | * Returns the Base Template Location which should be used for extending. |
||
110 | * |
||
111 | * @return string Base Template which should be used to extend from |
||
112 | * |
||
113 | */ |
||
114 | protected function getBaseTemplateLocation() |
||
118 | |||
119 | /** |
||
120 | * The Core Show Controller of this Bundle, renders the container templates, |
||
121 | * which have to include the static page content. |
||
122 | * |
||
123 | * @throws Symfony\Component\HttpKernel\Exception\NotFoundHttpException Not found Exception is thrown if no template with the given name exists. |
||
124 | * |
||
125 | * @param string $name The Name of the Static Page which should be loaded |
||
126 | * |
||
127 | * @return Response A Response instance |
||
128 | */ |
||
129 | public function showAction($name) |
||
150 | |||
151 | /** |
||
152 | * Define if translated files should be used or not. Translated files use an additional substring in the template path. |
||
153 | * e.g.: views/Content/foo.de.html.twig instead of views/Content/foo.html.twig |
||
154 | * |
||
155 | * Override this and return true to enable translations support |
||
156 | * |
||
157 | * @return boolean |
||
158 | */ |
||
159 | protected function isUsingTranslations() |
||
163 | |||
164 | /** |
||
165 | * Get the intermediate file path used for translated templates. |
||
166 | * |
||
167 | * @return string |
||
168 | */ |
||
169 | protected function getTranslationFilePath() |
||
173 | } |
||
174 |