本文整理汇总了PHP中Zend_View::setBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::setBasePath方法的具体用法?PHP Zend_View::setBasePath怎么用?PHP Zend_View::setBasePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::setBasePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
/**
* Возвращает данные виджета, для передачи в шаблон
*
* @return array
*/
public function getData()
{
// Инициализируем объект Zend_View (используем чистый Zend_View)
$this->_view = new Zend_View();
$this->_view->setBasePath(APPLICATION_PATH . '/templates/' . $this->_params['module']);
// Создаем из дерева разделов объект меню
$this->_categories = new Zend_Navigation($this->getCategoriesTree());
// Вычленяем часть дерева, если опциями заданы начальные вершины + определяем активную ветку
$this->_categories = $this->cropCategoriesTree()->setActiveBranch();
$CategoriesMenu = $this->_categories;
switch ($this->_options["type"]) {
case "breadcrumbs":
$menu = $this->getBreadcrumbs();
break;
case "childs":
$menu = $this->getChilds();
break;
case "ajar":
$menu = $this->getAjar();
break;
case "branch":
$menu = $this->getBranch();
break;
case "brothers":
$menu = $this->getBrothers();
break;
case "parent":
$menu = $this->getParents();
break;
default:
$menu = $this->getFull();
break;
}
// Пытаемся отрендерить меню с итераторами
$out = array();
try {
if (isset($this->_options['partial'])) {
$menu->setPartial(array($this->_options['partial'] . '.partial.php', $this->_params['module']));
}
$out['menu'] = $menu->render();
} catch (Exception $e) {
$menu->setPartial(null);
$out['menu'] = $menu->render();
}
// Получаем заголовки для меню
if ($CategoriesMenu->key()) {
$out['title'] = $CategoriesMenu->current()->getLabel();
$out['name'] = $CategoriesMenu->current()->get('name');
}
return $out;
}
示例2: __construct
/**
* @param array $data
*/
public function __construct(array $data = array())
{
$this->_view = new Zend_View();
if (isset($data['name'])) {
$this->_viewScriptName = $data['name'];
} else {
throw new InvalidArgumentException('Script name not setted!');
}
if (isset($data['basePath'])) {
$this->_view->setBasePath($data['basePath']);
}
if (isset($data['scriptPath'])) {
$this->_view->setScriptPath($data['scriptPath']);
}
parent::__construct($data);
}
示例3: postDispatch
public function postDispatch()
{
$response = $this->getResponse();
$view = new Zend_View();
$view->setBasePath(APPLICATION_PATH . '/views');
$response->append('footer', $view->render('footer.phtml'));
}
示例4: registerAction
public function registerAction()
{
$request = $this->getRequest();
$form = new Form_User_Registration();
if ($request->isPost()) {
if ($form->isValid($request->getPost())) {
$model = new Model_User($form->getValues());
$user_id = $model->save();
$model->setId($user_id);
$globalSession = Zend_Registry::get('dlo.session');
$globalSession->user = $model;
//Zend_Loader::loadClass('Zend_View');
$view = new Zend_View();
$view->activationLink = "http://DrivingLessonOnline.com/user/verify-email/id/" . $model->getId() . "/guid/" . hash('sha1', $model->getSalt() . $model->getId() . $model->getPassword()) . "/";
$view->setBasePath(APPLICATION_PATH . "/views/");
$mailBodyHtml = $view->render('Templates/Account-Activation-Email.phtml');
//send email verification email before user can start using their account.
$mail = new Zend_Mail();
$mail->setBodyHtml($mailBodyHtml);
$mail->setFrom('no.reply@DrivingLessonOnline.com', 'Registration');
$mail->addTo($model->getEmail(), $model->getDisplayName());
$mail->setSubject($model->getDisplayName() . ' activiate your account for Driving Lesson Online.com');
$mail->send();
//thank user and inform to check their email to enable their account.
$this->_redirect('/user/registered');
}
}
$this->view->form = $form;
}
示例5: _initView
protected function _initView()
{
$theme = 'default';
$templatePath = APPLICATION_PATH . '/../public/themes/' . $theme . '/templates';
Zend_Registry::set('user_date_format', 'm-d-Y');
Zend_Registry::set('calendar_date_format', 'mm-dd-yy');
Zend_Registry::set('db_date_format', 'Y-m-d');
Zend_Registry::set('perpage', 10);
Zend_Registry::set('menu', 'home');
Zend_Registry::set('eventid', '');
$dir_name = $_SERVER['DOCUMENT_ROOT'] . rtrim(str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']), '/');
Zend_Registry::set('acess_file_path', $dir_name . SEPARATOR . "application" . SEPARATOR . "modules" . SEPARATOR . "default" . SEPARATOR . "plugins" . SEPARATOR . "AccessControl.php");
Zend_Registry::set('siteconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "site_constants.php");
Zend_Registry::set('emailconstant_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "email_constants.php");
Zend_Registry::set('emptab_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "emptabconfigure.php");
Zend_Registry::set('emailconfig_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "mail_settings_constants.php");
Zend_Registry::set('application_file_path', $dir_name . SEPARATOR . "public" . SEPARATOR . "application_constants.php");
$date = new Zend_Date();
Zend_Registry::set('currentdate', $date->get('yyyy-MM-dd HH:mm:ss'));
Zend_Registry::set('currenttime', $date->get('HH:mm:ss'));
Zend_Registry::set('logo_url', '/public/images/landing_header.jpg');
$view = new Zend_View();
$view->setEscape('stripslashes');
$view->setBasePath($templatePath);
$view->setScriptPath(APPLICATION_PATH);
$view->addHelperPath('ZendX/JQuery/View/Helper', 'ZendX_JQuery_View_Helper');
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer();
$viewRenderer->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
return $this;
}
示例6: getView
/**
* Get the view
*
* @return Zend_View
*/
public function getView()
{
if (null === $this->_view) {
$this->_view = new Zend_View(array('strictVars' => true));
$this->_view->setBasePath($this->_getViewBasePath(), $this->_getViewBasePrefix());
$this->_view->renderer = $this;
}
return $this->_view;
}
示例7: postDispatch
public function postDispatch(Zend_Controller_Request_Abstract $request)
{
if ($request->getControllerName() != "api") {
$response = $this->getResponse();
$view = new Zend_View();
$view->setBasePath(Zend_Controller_Front::getInstance()->getParam('config')->BasePath . '/application/views');
$response->append('footer', $view->render('footer.phtml'));
}
}
示例8: render
protected function render($mailName)
{
$view = new Zend_View();
if (!$this->scriptPath) {
$this->scriptPath = ROOT_PATH . "/templates/mail";
}
$view->setBasePath($this->scriptPath);
$view->assign($this->assigns);
return $view->render($mailName . ".phtml");
}
示例9: sendWithTemplate
/**
*
* send email with a template
*
* @param string $type
* @param array $params
* @param string $toName
* @param array $toEmails
*/
public function sendWithTemplate($type, $params, $toName, $toEmails)
{
$view = new Zend_View();
$view->setBasePath(APPLICATION_PATH . '/modules/public/views/');
foreach ($params as $key => $value) {
$view->{$key} = $value;
}
if ($type == 'FORGOT_ADD_EXERCISE') {
$htmlMessage = $view->render('emails/forgotAddExercise.phtml');
}
$emailOptions = array('type' => 'html', 'email' => $htmlMessage);
$this->send($params['subject'], $toName, $toEmails, $emailOptions);
}
示例10: __construct
/**
* Constructor requiring Zend_Form instance to be rendered
* @param Zend_Form $form
*/
public function __construct(Zend_Form $form, $form_id = null)
{
// create view and specify doctype to have self-closing tags.
$view = new Zend_View();
$view->setBasePath(dirname(__FILE__));
$view->doctype('XHTML1_TRANSITIONAL');
$this->form = $form;
$this->form->setView(new Zend_View());
$this->form->setAttrib('class', 'form_dynamic');
if (!is_null($form_id)) {
$this->form->setAttrib('id', $form_id);
}
}
示例11: Topbox
/**
*
*/
public function Topbox($bezeichner)
{
$_Model = new Application_Model_Empfehlungen();
$box = $_Model->getByBezeichner($bezeichner);
if ($box) {
$view = new Zend_View();
$view->setBasePath(APPLICATION_PATH . '/views/');
$view->assign('box', $box);
$output = $view->render('_partials/topbox.phtml');
return $output;
} else {
return '';
}
}
示例12: __invoke
public function __invoke($message)
{
$layout = new Zend_Layout();
// Установка пути к скриптам макета:
$layout->setLayoutPath(APPLICATION_PATH . '/views/scripts/layouts');
$layout->setLayout('inner');
$view = new Zend_View();
$view->setBasePath(APPLICATION_PATH . '/views/');
$view->error_message = $message;
// установка переменных:
$layout->content = $view->render('/exeption/user.phtml');
echo $layout->render();
//echo $message;
die;
}
示例13: _initViewResource
protected function _initViewResource()
{
$config = $this->getOption('site');
// utf-8 support
if (function_exists('iconv')) {
iconv_set_encoding('internal_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');
}
if (function_exists('mb_internal_encoding')) {
mb_internal_encoding('UTF-8');
}
// init view
$view = new Zend_View(array('encoding' => 'UTF-8'));
$view->setBasePath($config['path'] . '/views')->addHelperPath(APPLICATION_PATH . '/views/helpers', 'View_Helper');
// helpers
$view->doctype('XHTML1_STRICT');
$view->headTitle('kp parser')->setSeparator(' >> ');
// init view renderer
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
Zend_Registry::set('Portal_View', $view);
return $view;
}
示例14: checkUser
* Kimai - Open Source Time Tracking // http://www.kimai.org
* (c) 2006-2009 Kimai-Development-Team
*
* Kimai is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; Version 3, 29 June 2007
*
* Kimai is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kimai; If not, see <http://www.gnu.org/licenses/>.
*/
// Include Basics
include '../../includes/basics.php';
$dir_templates = "templates/";
$datasrc = "config.ini";
$settings = parse_ini_file($datasrc);
$dir_ext = $settings['EXTENSION_DIR'];
$user = checkUser();
// =========================================
// = Get the currently displayed timeframe =
// =========================================
$timeframe = get_timeframe();
$in = $timeframe[0];
$out = $timeframe[1];
$view = new Zend_View();
$view->setBasePath(WEBROOT . 'extensions/' . $dir_ext . '/' . $dir_templates);
echo $view->render('index.php');
示例15: setBasePath
/**
* @override
*/
public function setBasePath($path, $prefix = 'Zend_View')
{
$this->_zendView->setBasePath($path, $prefix);
return parent::setBasePath($path);
}