public function QPTPL::tpl in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/Extension/QPTPL.php \QPTPL::tpl()
- 7.2 QueryPath/Extension/QPTPL.php \QPTPL::tpl()
File
- QueryPath/
Extension/ QPTPL.php, line 11
Class
Code
public function tpl($template, $object, $options = array()) {
$tqp = qp($template);
if (is_array($object) || $object instanceof Traversable) {
$this
->tplArrayR($tqp, $object, $options);
return $this->qp
->append($tqp
->top());
}
elseif (is_object($object)) {
$this
->tplObject($tqp, $object, $options);
}
return $this->qp
->append($tqp
->top());
}