summaryrefslogtreecommitdiff
path: root/src/Compile/DefaultHandlerBlockCompiler.php
blob: 394a6e76dbf9961951f2763b0c580822506d62f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

namespace Smarty\Compile;

class DefaultHandlerBlockCompiler extends BlockCompiler {
	/**
	 * @inheritDoc
	 */
	protected function getIsCallableCode($tag, $function): string {
		return "\$_smarty_tpl->getSmarty()->getRuntime('DefaultPluginHandler')->hasPlugin(" .
			var_export($function, true) . ", 'block')";
	}

	/**
	 * @inheritDoc
	 */
	protected function getFullCallbackCode($tag, $function): string {
		return "\$_smarty_tpl->getSmarty()->getRuntime('DefaultPluginHandler')->getCallback(" .
			var_export($function, true) . ", 'block')";
	}

	/**
	 * @inheritDoc
	 */
	protected function blockIsCacheable(\Smarty\Smarty $smarty, $function): bool {
		return true;
	}

}