_path; } /** * * set view partials path * * @param string $path * * @return $this */ public function setPath($path) { $this->_path = rtrim($path, DIRECTORY_SEPARATOR); return $this; } /** * * process view partial and return output * * @param string $partial view partial name/path * @param array $data input data to be handled by the view partial * @param string $path view partials path * * @return string|$this partial output */ public function partial($partial = null, array $data = null, $path = null) { if ($partial === null) { return $this; } $this->setPath($path); $this->setPartial($partial); $view = clone $this->getView(); $view->clearVariables(); if ($data !== null) { $view->setVariables($data); } $file = $this->getPath() . DIRECTORY_SEPARATOR . $this->getPartial(); return $view->process( $file, true); } }