Lines Matching refs:name

59      * Returns the template name.
61 * @return string The template name
136 * @param string $name The block name to display from the parent
140 public function displayParentBlock($name, array $context, array $blocks = [])
142 if (isset($this->traits[$name])) {
143 $this->traits[$name][0]->displayBlock($name, $context, $blocks, false);
145 $parent->displayBlock($name, $context, $blocks, false);
147 throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext());
157 * @param string $name The block name to display
162 public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true, self $templateContext = null)
164 if ($useBlocks && isset($blocks[$name])) {
165 $template = $blocks[$name][0];
166 $block = $blocks[$name][1];
167 } elseif (isset($this->blocks[$name])) {
168 $template = $this->blocks[$name][0];
169 $block = $this->blocks[$name][1];
202 $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);
203 } elseif (isset($blocks[$name])) {
204 throw new RuntimeError(sprintf('Block "%s" should not call parent() in "%s" as the block does not exist in the parent template "%s".', $name, $blocks[$name][0]->getTemplateName(), $this->getTemplateName()), -1, $blocks[$name][0]->getSourceContext());
206 throw new RuntimeError(sprintf('Block "%s" on template "%s" does not exist.', $name, $this->getTemplateName()), -1, ($templateContext ?? $this)->getSourceContext());
216 * @param string $name The block name to render from the parent
222 public function renderParentBlock($name, array $context, array $blocks = [])
229 $this->displayParentBlock($name, $context, $blocks);
240 * @param string $name The block name to render
247 public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true)
254 $this->displayBlock($name, $context, $blocks, $useBlocks);
265 * @param string $name The block name
271 public function hasBlock($name, array $context, array $blocks = [])
273 if (isset($blocks[$name])) {
274 return $blocks[$name][0] instanceof self;
277 if (isset($this->blocks[$name])) {
282 return $parent->hasBlock($name, $context);