本文整理汇总了PHP中Site::urlManager方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::urlManager方法的具体用法?PHP Site::urlManager怎么用?PHP Site::urlManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::urlManager方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getControllerAction
/**
* Parses a path info into an action ID and GET variables.
* @param string $pathInfo path info
* @return string action ID
*/
protected function getControllerAction($pathInfo)
{
if (($pos = strpos($pathInfo, '/')) !== false) {
$manager = \Site::urlManager();
$manager->parsePathInfo((string) substr($pathInfo, $pos + 1));
$actionID = substr($pathInfo, 0, $pos);
return $manager->caseSensitive ? $actionID : strtolower($actionID);
} else {
return $pathInfo;
}
}
示例2: init
public function init()
{
try {
$this->uploadTarget = \Site::urlManager()->createUrl('site/front/ajaxWidget', array('widget_method' => 'upload', 'widget_class' => $this->className()));
if (empty($this->max_file_size)) {
$this->max_file_size = \GO::config()->max_file_size;
}
\Site::scripts()->registerGapiScript('jquery');
\Site::scripts()->registerGapiScript('jquery-ui');
$assetUrl = \Site::assetManager()->publish(\GO::config()->root_path . 'modules/site/widget/plupload/assets');
$this->_swfUrl = $assetUrl . '/assets/js/plupload.flash.swf';
\Site::scripts()->registerCssFile($assetUrl . '/assets/style.css');
\Site::scripts()->registerScriptFile($assetUrl . '/assets/js/plupload.full.js');
\Site::scripts()->registerScriptFile($assetUrl . '/assets/js/jquery.plupload.queue/jquery.plupload.queue.js');
$langFile = '/assets/js/i18n/' . \GO::language()->getLanguage() . '.js';
// if(file_exists(\Site::assetManager()->getBasePath().$langFile)){
\Site::scripts()->registerScriptFile($assetUrl . $langFile);
// }
} catch (\Exception $e) {
echo '<h2 style="color:red;">AN ERROR HAS OCCURED</h2>';
//echo '<p style="color:red;">'.$e->getMessage().'</p>';
echo '<p style="color:red;">Please check if the folder( <b>' . \GO::config()->assets_path . '</b> ) is writable for the webserver.<br />This path is also configurable in the Group-Office <b>config.php</b> file.<br />Please check the options: <b>assets_path</b> and <b>assets_url</b></p>';
}
}
示例3:
</tr>
<?php
}
?>
<tr>
<td><label><?php
echo \GO::t('rememberme', 'defaultsite');
?>
</label></td>
<td><input type="checkbox" name="rememberMe" value="rememberMe"></tr>
</tr>
</table>
<div class="button-bar">
<input class="button" type="submit" id="submit-login-button" value="Login">
<a id="recover-login-button" href="<?php
echo \Site::urlManager()->createUrl('/site/account/recoverpassword');
?>
" class="button"><?php
echo \GO::t('lostPassword', 'defaultsite');
?>
</a>
<div class="clear"></div>
</div>
<?php
echo $form->endForm();
?>
</div>
</div>
示例4: actionLogout
/**
* Logout the current user and redirect to loginpage
*/
public function actionLogout()
{
\GO::session()->logout();
\GO::session()->start();
$this->redirect(\Site::urlManager()->getHomeUrl());
}
示例5: TOC
?>
<div class="col-md-3">
<div data-spy="affix" data-offset-top="100" class="panel panel-default toc">
<div class="panel-heading">Table of contents</div>
<div class="panel-body">
<?php
$toc = new TOC(array('content' => $content));
echo $toc->render();
?>
<div class="nav-bottom">
<!--<div class="top-link"><a title="Jump to the top of the page" href="#header"><span class="glyphicon glyphicon-chevron-up"></span> Jump to top</a></div>-->
<div class="home-link"><a title="Go to home page" href="<?php
echo Site::urlManager()->getHomeUrl();
?>
"><span class="glyphicon glyphicon-chevron-left"></span> Home</a></div>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<?php
} else {
echo '<div class="col-md-12">';
示例6: foreach
echo $message->getAttribute("content", "html");
?>
</p>
<?php
if (!empty($message->attachments)) {
?>
<span class="ticketmessage-files"><?php
echo \GO::t('ticketFiles', 'defaultsite');
?>
:</span>
<?php
foreach ($message->getFiles() as $file => $obj) {
?>
<a target="_blank" href="<?php
echo \Site::urlManager()->createUrl('tickets/site/downloadAttachment', array('file' => $obj->id, 'ticket_number' => $ticket->ticket_number, 'ticket_verifier' => $ticket->ticket_verifier));
?>
">
<?php
echo $file;
?>
</a>
<?php
}
?>
<?php
}
?>
<?php
if ($message->has_status) {
示例7:
$form = new \GO\Site\Widget\Form();
?>
<?php
echo $form->beginForm();
?>
<?php
if (Site::notifier()->hasMessage('success')) {
?>
<div class="notification success"><?php
echo Site::notifier()->getMessage('success');
?>
</div>
<div class="button-bar">
<a id="reset-login-button" class="button" href="<?php
echo Site::urlManager()->createUrl('/site/account/login');
?>
"><?php
echo \GO::t('login', 'defaultsite');
?>
</a>
<div class="clear"></div>
</div>
<?php
} else {
?>
<?php
if (Site::notifier()->hasMessage('error')) {
?>
<div class="notification error"><?php
示例8:
<?php
\Site::scripts()->registerCssFile(\Site::file('css/ticket.css'));
?>
<div class="external-ticket-page newticket ticket">
<div class="wrapper">
<?php
if (\GO::user()) {
?>
<< <a id="back-to-overview-button" href="<?php
echo \Site::urlManager()->createUrl('tickets/externalpage/ticketlist');
?>
"><?php
echo \GO::t('ticketBackToList', 'defaultsite');
?>
</a>
<?php
}
?>
<h2><?php
echo \GO::t('ticketNewTicket', 'defaultsite');
?>
</h2>
<?php
示例9: foreach
<tr><td colspan="5"><?php
echo \GO::t('ticketNoneFound', 'defaultsite');
?>
</td></tr>
<?php
} else {
?>
<?php
foreach ($pager->getItems() as $i => $ticket) {
?>
<tr class="<?php
echo $i % 2 ? 'even' : 'odd';
?>
">
<td><?php
echo '<a href="' . \Site::urlManager()->createUrl("tickets/externalpage/ticket", array("ticket_number" => $ticket->ticket_number, "ticket_verifier" => $ticket->ticket_verifier)) . '">' . $ticket->ticket_number . '</a>';
?>
</td>
<td><?php
echo $ticket->subject;
?>
</td>
<td><?php
echo $ticket->getStatusName();
?>
</td>
<td><?php
echo $ticket->agent ? $ticket->agent->name : "";
?>
</td>
<td><?php
示例10: getPageUrl
/**
* The link for the page with the given number
* @param int $pageNum number of page
* @return string URL to page
*/
private function getPageUrl($pageNum)
{
$params = array_merge($_GET, array($this->requestPrefix . $this->pageParam => $pageNum));
return \Site::urlManager()->createUrl(\Site::router()->getRoute(), $params);
}
示例11: setReturnUrl
/**
* Return to this url its return value can be used in redirect()
* @param type $url
*/
public function setReturnUrl($url)
{
if (is_array($url)) {
$route = isset($url[0]) ? $url[0] : '';
$url = \Site::urlManager()->createUrl($route, array_splice($url, 1));
}
\GO::session()->values['sites']['returnUrl'] = $url;
}
示例12: array
<h1><?php
echo \GO::t('ticketCreatedTitle', 'defaultsite');
?>
</h1>
<p><?php
echo \GO::t('ticketCreatedText', 'defaultsite');
?>
</p>
<?php
echo '<a href="' . \Site::urlManager()->createUrl("tickets/externalpage/ticket", array("ticket_number" => $ticket->ticket_number, "ticket_verifier" => $ticket->ticket_verifier)) . '">' . \GO::t('gotoTicket', 'defaultsite') . '</a>';
示例13: thumb
/**
* Get a thumbnail URL for user uploaded files. This does not work for template
* images.
*
* @param string $relativePath
* @param array $thumbParams
* @return string URL to thumbnail
*/
public static function thumb($relativePath, $thumbParams = array("lw" => 100, "ph" => 100, "zc" => 1))
{
$file = new \GO\Base\Fs\File(\GO::config()->file_storage_path . $relativePath);
$thumbParams['filemtime'] = $file->mtime();
$thumbParams['src'] = $relativePath;
return \Site::urlManager()->createUrl('site/front/thumb', $thumbParams);
}