本文整理汇总了PHP中Zend_View::serverUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::serverUrl方法的具体用法?PHP Zend_View::serverUrl怎么用?PHP Zend_View::serverUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::serverUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forgetPassword
public function forgetPassword($controller, $model, $module = "default")
{
$view = new Zend_View();
$items = $model->getItemsByCriteria(array("email=?" => $model->email));
//print_r($exhibitors);exit;
if (count($items["rows"]) > 0) {
list($item) = $items["rows"];
}
if (isset($item)) {
//$mail_model=Default_Model_Mail();
$timestamp = time();
$security_code = md5($item->id . $timestamp . $item->created);
$retrieve_pw_uri = $view->serverUrl() . $view->url(array("module" => $module, "controller" => $controller, "action" => "resetpw", "id" => $item->id, "t" => $timestamp, "c" => $security_code), null, true);
return $retrieve_pw_uri;
} else {
return null;
}
}
示例2: getConfig
/**
* Get config
*
* @throws Zend_Controller_Action_Exception
* @return array
*/
public function getConfig()
{
if (!Zend_Registry::isRegistered('googleConfig')) {
throw new Zend_Controller_Action_Exception('Google oAuth: config not found');
}
$config = Zend_Registry::get('googleConfig');
if (empty($config['consumerKey'])) {
throw new Zend_Controller_Action_Exception('Google oAuth: consumer key is missed');
}
if (empty($config['consumerSecret'])) {
throw new Zend_Controller_Action_Exception('Google oAuth: consumer secret is missed');
}
if (strpos($config['callbackUrl'], 'http') !== 0) {
$view = new Zend_View();
$config['callbackUrl'] = $view->serverUrl($config['callbackUrl']);
}
return $config;
}
示例3: getClient
/**
* Get twitter client
*
* @throws Zend_Controller_Action_Exception
* @return Zend_Oauth_Consumer
*/
public function getClient()
{
if (!$this->_client) {
if (!Zend_Registry::isRegistered('twitterConfig')) {
throw new Zend_Controller_Action_Exception('Twitter oAuth: config not found');
}
$config = Zend_Registry::get('twitterConfig');
if (empty($config['consumerKey'])) {
throw new Zend_Controller_Action_Exception('Twitter oAuth: consumer key is missed');
}
if (empty($config['consumerSecret'])) {
throw new Zend_Controller_Action_Exception('Twitter oAuth: consumer secret is missed');
}
if (strpos($config['callbackUrl'], 'http') !== 0) {
$view = new Zend_View();
$config['callbackUrl'] = $view->serverUrl($config['callbackUrl']);
}
$this->setClient(new Zend_Oauth_Consumer($config));
}
return $this->_client;
}
示例4: afterSave
function afterSave()
{
$session = SessionWrapper::getInstance();
# add log to audit trail
$view = new Zend_View();
$url = $view->serverUrl($view->baseUrl('role/view/id/' . encode($this->getID())));
$usecase = '0.4';
$module = '0';
$type = SYSTEM_CREATEROLE;
$details = "Role <a href='" . $url . "' class='blockanchor'>" . $this->getName() . "</a> created";
$browser = new Browser();
$audit_values = $session->getVar('browseraudit');
$audit_values['module'] = $module;
$audit_values['usecase'] = $usecase;
$audit_values['transactiontype'] = $type;
$audit_values['status'] = "Y";
$audit_values['userid'] = $session->getVar('userid');
$audit_values['transactiondetails'] = $details;
$audit_values['url'] = $url;
// debugMessage($audit_values);
$this->notify(new sfEvent($this, $type, $audit_values));
}
示例5: getProfilePath
function getProfilePath()
{
$path = "";
$view = new Zend_View();
// $path = '<a href="'.$view->serverUrl($view->baseUrl('user/'.strtolower($this->getUserName()))).'">'.$view->serverUrl($view->baseUrl('user/'.strtolower($this->getUserName()))).'</a>';
$path = '<a href="javascript: void(0)">' . $view->serverUrl($view->baseUrl('user/' . strtolower($this->getUserName()))) . '</a>';
return $path;
}
示例6: compile
/**
* Compile a less file
*
* @param \Zend_View $view
* @param string $href The less file
* @param boolean $always Always compile
* @return boolean True when changed
*/
public function compile(\Zend_View $view, $href, $always = false)
{
if (\MUtil_String::startsWith($href, 'http', true)) {
// When a local url, strip the serverUrl and basepath
$base = $view->serverUrl() . $view->baseUrl();
if (\MUtil_String::startsWith($href, $base, true)) {
// Only strip when urls match
$href = substr($href, strlen($base));
}
}
// Add full path to the webdir
$inFile = $this->_webroot . '/' . $href;
$outFile = substr($inFile, 0, -strlen(pathinfo($inFile, PATHINFO_EXTENSION))) . 'css';
// Try compiling
try {
// \MUtil_Echo::track($inFile, $outFile);
$lessc = new lessc();
$lessc->registerFunction('base64encode', array($this, 'base64encode'));
if ($always || array_key_exists('compilecss', \Zend_Controller_Front::getInstance()->getRequest()->getParams())) {
$result = (bool) $lessc->compileFile($inFile, $outFile);
} else {
$result = $lessc->checkedCompile($inFile, $outFile);
}
} catch (\Exception $exc) {
// If we have an error, present it if not in production
if (APPLICATION_ENV !== 'production' || APPLICATION_ENV !== 'acceptance') {
\MUtil_Echo::pre($exc->getMessage());
}
$result = null;
}
return $result;
}
示例7: enviarEmailSenha
/**
* Envia um email com os dados para Recuperacao/alteração da senha do usuário
* @param Administrativo_Model_Usuario $oUsuario instancia do usuario
*/
public static function enviarEmailSenha(Administrativo_Model_Usuario $oUsuario)
{
$sHash = $oUsuario->criarHash();
$oView = new Zend_View();
$oView->setScriptPath(APPLICATION_PATH . '/modules/auth/views/scripts/login/');
$oView->sUrlRecuperarSenha = $oView->serverUrl("/auth/login/recuperar-senha/hash/{$sHash}");
$oView->nome = $oUsuario->getEntity()->getNome();
$sTextoEmail = $oView->render('email-recuperacao-senha.phtml');
$oTranslate = Zend_Registry::get('Zend_Translate');
DBSeller_Helper_Mail_Mail::send($oUsuario->getEmail(), $oTranslate->_('ECidadeOnline2 - Recuperação de Senha'), $sTextoEmail);
}