Lines Matching defs:context

4  * contain some utility method to get context and helpers
111 * @param mixed $context current context
116 public function render($context)
118 if (!$context instanceof Context) {
119 $context = new Context($context, [
142 $buffer .= $this->section($context, $current);
149 $buffer .= $this->inverted($context, $current);
157 $buffer .= $this->partial($context, $current);
161 $buffer .= $this->variables($context, $current, false);
164 $buffer .= $this->variables($context, $current, true);
220 * @param Context $context current context
226 private function section(Context $context, $current)
242 $context, //Second is current context
249 return $this->handlebars->loadString($return)->render($context);
257 $sectionVar = $context->get($sectionName, true);
266 $context->pushIndex($index);
267 $context->push($d);
268 $buffer .= $this->render($context);
269 $context->pop();
270 $context->popIndex();
274 $context->push($sectionVar);
275 $buffer = $this->render($context);
276 $context->pop();
278 $buffer = $this->render($context);
292 * @param Context $context current context
297 private function inverted(Context $context, $current)
300 $data = $context->get($sectionName);
302 return $this->render($context);
312 * @param Context $context current context
317 private function partial(Context $context, $current)
322 $context = $context->get($current[Tokenizer::ARGS]);
325 return $partial->render($context);
331 * @param Context $context current context
337 private function variables(Context $context, $current, $escaped)
340 $value = $context->get($name);
346 $variable = $context->getDataVariable($name);
355 return $context->lastIndex();
358 return $context->lastKey();