PageRenderTime 26ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/vendor/phalcon/devtools/ide/1.3.4/Phalcon/Mvc/View/Engine/Volt/Compiler.php

https://gitlab.com/habracoder/advertising
PHP | 477 lines | 70 code | 111 blank | 296 comment | 0 complexity | 862c1bf6585664f0fa4966c89398dc47 MD5 | raw file
  1. <?php
  2. namespace Phalcon\Mvc\View\Engine\Volt {
  3. /**
  4. * Phalcon\Mvc\View\Engine\Volt\Compiler
  5. *
  6. * This class reads and compiles Volt templates into PHP plain code
  7. *
  8. *<code>
  9. * $compiler = new \Phalcon\Mvc\View\Engine\Volt\Compiler();
  10. *
  11. * $compiler->compile('views/partials/header.volt');
  12. *
  13. * require $compiler->getCompiledTemplatePath();
  14. *</code>
  15. */
  16. class Compiler implements \Phalcon\DI\InjectionAwareInterface {
  17. protected $_dependencyInjector;
  18. protected $_view;
  19. protected $_options;
  20. protected $_arrayHelpers;
  21. protected $_level;
  22. protected $_foreachLevel;
  23. protected $_blockLevel;
  24. protected $_exprLevel;
  25. protected $_extended;
  26. protected $_autoescape;
  27. protected $_extendedBlocks;
  28. protected $_currentBlock;
  29. protected $_blocks;
  30. protected $_forElsePointers;
  31. protected $_loopPointers;
  32. protected $_extensions;
  33. protected $_functions;
  34. protected $_filters;
  35. protected $_macros;
  36. protected $_prefix;
  37. protected $_currentPath;
  38. protected $_compiledTemplatePath;
  39. /**
  40. * \Phalcon\Mvc\View\Engine\Volt\Compiler
  41. *
  42. * @param \Phalcon\Mvc\ViewInterface $view
  43. */
  44. public function __construct($view=null){ }
  45. /**
  46. * Sets the dependency injector
  47. *
  48. * @param \Phalcon\DiInterface $dependencyInjector
  49. */
  50. public function setDI($dependencyInjector){ }
  51. /**
  52. * Returns the internal dependency injector
  53. *
  54. * @return \Phalcon\DiInterface
  55. */
  56. public function getDI(){ }
  57. /**
  58. * Sets the compiler options
  59. *
  60. * @param array $options
  61. */
  62. public function setOptions($options){ }
  63. /**
  64. * Sets a single compiler option
  65. *
  66. * @param string $option
  67. * @param string $value
  68. */
  69. public function setOption($option, $value){ }
  70. /**
  71. * Returns a compiler's option
  72. *
  73. * @param string $option
  74. * @return string
  75. */
  76. public function getOption($option){ }
  77. /**
  78. * Returns the compiler options
  79. *
  80. * @return array
  81. */
  82. public function getOptions(){ }
  83. /**
  84. * Fires an event to registered extensions
  85. *
  86. * @param string $name
  87. * @param array $arguments
  88. * @return mixed
  89. */
  90. public function fireExtensionEvent($name, $arguments=null){ }
  91. /**
  92. * Registers a Volt's extension
  93. *
  94. * @param object $extension
  95. * @return \Phalcon\Mvc\View\Engine\Volt\Compiler
  96. */
  97. public function addExtension($extension){ }
  98. /**
  99. * Returns the list of extensions registered in Volt
  100. *
  101. * @return array
  102. */
  103. public function getExtensions(){ }
  104. /**
  105. * Register a new function in the compiler
  106. *
  107. * @param string $name
  108. * @param Closure|string $definition
  109. * @return \Phalcon\Mvc\View\Engine\Volt\Compiler
  110. */
  111. public function addFunction($name, $definition){ }
  112. /**
  113. * Register the user registered functions
  114. *
  115. * @return array
  116. */
  117. public function getFunctions(){ }
  118. /**
  119. * Register a new filter in the compiler
  120. *
  121. * @param string $name
  122. * @param Closure|string $definition
  123. * @return \Phalcon\Mvc\View\Engine\Volt\Compiler
  124. */
  125. public function addFilter($name, $definition){ }
  126. /**
  127. * Register the user registered filters
  128. *
  129. * @return array
  130. */
  131. public function getFilters(){ }
  132. /**
  133. * Set a unique prefix to be used as prefix for compiled variables
  134. *
  135. * @param string $prefix
  136. * @return \Phalcon\Mvc\View\Engine\Volt\Compiler
  137. */
  138. public function setUniquePrefix($prefix){ }
  139. /**
  140. * Return a unique prefix to be used as prefix for compiled variables and contexts
  141. *
  142. * @return string
  143. */
  144. public function getUniquePrefix(){ }
  145. /**
  146. * Resolves attribute reading
  147. *
  148. * @param array $expr
  149. * @return string
  150. */
  151. public function attributeReader($expr){ }
  152. /**
  153. * Resolves function intermediate code into PHP function calls
  154. *
  155. * @param array $expr
  156. * @return string
  157. */
  158. public function functionCall($expr){ }
  159. /**
  160. * Resolves filter intermediate code into a valid PHP expression
  161. *
  162. * @param array $test
  163. * @param string $left
  164. * @return string
  165. */
  166. public function resolveTest($test, $left){ }
  167. /**
  168. * Resolves filter intermediate code into PHP function calls
  169. *
  170. * @param array $filter
  171. * @param string $left
  172. * @return string
  173. */
  174. protected function resolveFilter(){ }
  175. /**
  176. * Resolves an expression node in an AST volt tree
  177. *
  178. * @param array $expr
  179. * @return string
  180. */
  181. public function expression($expr){ }
  182. /**
  183. * Compiles a block of statements
  184. *
  185. * @param array $statements
  186. * @return string|array
  187. */
  188. protected function _statementListOrExtends(){ }
  189. /**
  190. * Compiles a 'foreach' intermediate code representation into plain PHP code
  191. *
  192. * @param array $statement
  193. * @param boolean $extendsMode
  194. * @return string
  195. */
  196. public function compileForeach($statement, $extendsMode=null){ }
  197. /**
  198. * Generates a 'forelse' PHP code
  199. *
  200. * @return string
  201. */
  202. public function compileForElse(){ }
  203. /**
  204. * Compiles a 'if' statement returning PHP code
  205. *
  206. * @param array $statement
  207. * @param boolean $extendsMode
  208. * @return string
  209. */
  210. public function compileIf($statement, $extendsMode=null){ }
  211. /**
  212. * Compiles a 'elseif' statement returning PHP code
  213. *
  214. * @param array $statement
  215. * @return string
  216. */
  217. public function compileElseIf($statement){ }
  218. /**
  219. * Compiles a 'cache' statement returning PHP code
  220. *
  221. * @param array $statement
  222. * @param boolean $extendsMode
  223. * @return string
  224. */
  225. public function compileCache($statement, $extendsMode=null){ }
  226. /**
  227. * Compiles a '{{' '}}' statement returning PHP code
  228. *
  229. * @param array $statement
  230. * @param boolean $extendsMode
  231. * @return string
  232. */
  233. public function compileEcho($statement){ }
  234. /**
  235. * Compiles a 'include' statement returning PHP code
  236. *
  237. * @param array $statement
  238. * @return string
  239. */
  240. public function compileInclude($statement){ }
  241. /**
  242. * Compiles a 'set' statement returning PHP code
  243. *
  244. * @param array $statement
  245. * @return string
  246. */
  247. public function compileSet($statement){ }
  248. /**
  249. * Compiles a 'do' statement returning PHP code
  250. *
  251. * @param array $statement
  252. * @param boolean $extendsMode
  253. * @return string
  254. */
  255. public function compileDo($statement){ }
  256. /**
  257. * Compiles a 'return' statement returning PHP code
  258. *
  259. * @param array $statement
  260. * @param boolean $extendsMode
  261. * @return string
  262. */
  263. public function compileReturn($statement){ }
  264. /**
  265. * Compiles a 'autoescape' statement returning PHP code
  266. *
  267. * @param array $statement
  268. * @param boolean $extendsMode
  269. * @return string
  270. */
  271. public function compileAutoEscape($statement, $extendsMode){ }
  272. /**
  273. * Compiles macros
  274. *
  275. * @param array $statement
  276. * @param boolean $extendsMode
  277. * @return string
  278. */
  279. public function compileMacro($statement, $extendsMode){ }
  280. /**
  281. * Compiles calls to macros
  282. *
  283. * @param array $statement
  284. * @param boolean $extendsMode
  285. * @return string
  286. */
  287. public function compileCall(){ }
  288. /**
  289. * Traverses a statement list compiling each of its nodes
  290. *
  291. * @param array $statement
  292. * @return string
  293. */
  294. protected function _statementList(){ }
  295. /**
  296. * Compiles a Volt source code returning a PHP plain version
  297. *
  298. * @param string $viewCode
  299. * @param boolean $extendsMode
  300. * @return string
  301. */
  302. protected function _compileSource(){ }
  303. /**
  304. * Compiles a template into a string
  305. *
  306. *<code>
  307. * echo $compiler->compileString('{{ "hello world" }}');
  308. *</code>
  309. *
  310. * @param string $viewCode
  311. * @param boolean $extendsMode
  312. * @return string
  313. */
  314. public function compileString($viewCode, $extendsMode=null){ }
  315. /**
  316. * Compiles a template into a file forcing the destination path
  317. *
  318. *<code>
  319. * $compiler->compile('views/layouts/main.volt', 'views/layouts/main.volt.php');
  320. *</code>
  321. *
  322. * @param string $path
  323. * @param string $compiledPath
  324. * @param boolean $extendsMode
  325. * @return string|array
  326. */
  327. public function compileFile($path, $compiledPath, $extendsMode=null){ }
  328. /**
  329. * Compiles a template into a file applying the compiler options
  330. * This method does not return the compiled path if the template was not compiled
  331. *
  332. *<code>
  333. * $compiler->compile('views/layouts/main.volt');
  334. * require $compiler->getCompiledTemplatePath();
  335. *</code>
  336. *
  337. * @param string $templatePath
  338. * @param boolean $extendsMode
  339. * @return string|array
  340. */
  341. public function compile($templatePath, $extendsMode=null){ }
  342. /**
  343. * Returns the path that is currently being compiled
  344. *
  345. * @return string
  346. */
  347. public function getTemplatePath(){ }
  348. /**
  349. * Returns the path to the last compiled template
  350. *
  351. * @return string
  352. */
  353. public function getCompiledTemplatePath(){ }
  354. /**
  355. * Parses a Volt template returning its intermediate representation
  356. *
  357. *<code>
  358. * print_r($compiler->parse('{{ 3 + 2 }}'));
  359. *</code>
  360. *
  361. * @param string $viewCode
  362. * @return array
  363. */
  364. public function parse($viewCode){ }
  365. }
  366. }