本文整理汇总了PHP中Zend_View_Interface::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Interface::url方法的具体用法?PHP Zend_View_Interface::url怎么用?PHP Zend_View_Interface::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Interface
的用法示例。
在下文中一共展示了Zend_View_Interface::url方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: menu
/**
* @return string
*/
public function menu()
{
$model = new Site_Model_Menu();
$items = $model->fetchAll(null, 'orderid');
$activeItem = $model->fetchRow(array('"' . addcslashes($this->view->url(), "'") . '" LIKE CONCAT("%",url,"%")'), 'LENGTH(url) desc');
$this->view->items = $items;
if ($activeItem) {
$this->view->activeId = $activeItem->id;
}
return $this->view->render('menu.phtml');
}
示例2: columnSort
/**
* Fungsi utama untuk sorting
*
* @param array $sorter komponen sorting
* @param array $options settingan sorting
*
* @return string
*/
function columnSort($sorter, $options)
{
$html = '';
// Menampilkan nama kolom
$html .= '<a href="' . $this->view->url($sorter) . '#firstsection' . '">';
$html .= $options['title'];
$html .= '</a>';
// Menampilkan gambar sorting
if ($sorter['sortby'] == $options['param']) {
$html .= '<span class="img-sort">' . $this->view->statusSort($sorter['sortorder']) . '</span>';
}
return $html;
}
示例3: form
/**
* Generates a form element (and corresponding close tag)
*
* @param string|array either a url or set of url parameters to use as the form's action
* @param boolean (optional) whether this is an close tag
* @param string (optional) method to use for this form
* @param array (optional) collection of attributes to apply to this tag
* @return string
*/
public function form($url, $close = false, $method = 'post', $attribs = null)
{
if ($close) {
return '</form>';
}
if (is_array($url)) {
$url = $this->_view->url($url);
}
if ($attribs !== null) {
$attribs = array_map(array(get_class($this), 'produce_combined'), array_keys($attribs), array_values($attribs));
$attribs = ' ' . implode($attribs, ' ');
} else {
$attribs = '';
}
return "<form action=\"{$url}\" method=\"{$method}\"{$attribs}>";
}
示例4: _renderMenuItem
/**
* Render a menu item
*
* @param Zym_Menu_Item $item
* @return string
*/
protected function _renderMenuItem(Zym_Menu_Item $item, $menuClass)
{
$link = null;
$target = $item->getTarget();
if (!empty($target)) {
if (is_array($target)) {
$link = (string) $this->_view->url($target, null, true);
} else {
$link = (string) $target;
}
}
$xhtml .= sprintf('<li id="%s" class="%sitem', $item->getId(), $menuClass);
if ($item->isSelected()) {
$xhtml .= ' activeMenuItem';
}
$xhtml .= '">';
if (!empty($link)) {
$xhtml .= sprintf('<a class="%sitemlabel" href="%s">%s</a>', $menuClass, $link, $item->getLabel());
} else {
$xhtml .= $item->getLabel();
}
if ($item->hasMenuItems()) {
$xhtml .= $this->_renderMenu($item, $menuClass);
}
$xhtml .= '</li>';
return $xhtml;
}
示例5: _renderMenuItem
/**
* Render a menu item
*
* @param Zym_Menu_Item $item
* @return string
*/
protected function _renderMenuItem(Zym_Menu_Item $item)
{
$link = null;
$target = $item->getTarget();
if (!empty($target)) {
if (is_array($target)) {
$link = $this->_view->url($target, null, true);
} else {
$link = (string) $target;
}
}
$js .= sprintf('{text:"%s"', $item->getLabel());
if ($item->isSelected()) {
$js .= ',selected:true';
}
if (!empty($link)) {
$js .= sprintf(',url:"%s"', $link);
}
if ($item->hasMenuItems()) {
$js .= sprintf(',submenu:{id:"%s",itemdata:%s}', $item->getId(), $this->_renderMenu($item));
}
$js .= '}';
return $js;
}
示例6: lockIcon
/**
* Output a lock icon which also serves as a link to unlock a page (if the user has permission
* to do this)
*
* @param Array menu item array for this lock
* @param DbUserModel user that is currently logged in
* @return string
*/
public function lockIcon($menu, DbUserModel $user)
{
if ($menu['locked']) {
$user = new DbUserModel(array('dbUserID' => $menu['locked'], 'depth' => 'dbUser'));
$title = "Currently locked by '{$this->h($user->dbUserFullName)}'.";
if ($user->hasAccess('edit', $menu['page']) || $user->hasAccess('approve', $menu['page'])) {
$title .= ' Click to unlock.';
$html = $this->view->linkTo('#', $this->view->imageTag('icons/ffffff/lock_small.png', array('id' => $this->view->url(array('action' => 'unlock', 'id' => $menu['page']->pageID)), 'class' => 'inline lock tooltip', 'tooltip' => $title)));
} else {
$html = $this->view->imageTag('icons/ffffff/lock_small.png', array('class' => 'inline', 'title' => $title));
}
} else {
$html = '';
}
return $html;
}
示例7: topLinks
/**
* Returns a link for the header bar of a page
*
* @param PageModel current page
* @param DbUserModel currently logged in user
* @param integer The current page number
* @return string
*/
public function topLinks($page, $user, $spNum)
{
if ($page->numQuestions <= 0) {
return;
}
$current = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
$actions = "<li class=\"current\">{$current}</li>";
//TODO need to relocate this list of available actions somewhere more appropriate
foreach (array('view', 'edit', 'approve') as $action) {
if ($action !== $current && $user->hasAccess($action, $page)) {
$links[] = $this->view->linkTo($this->view->url(array('action' => $action, 'id' => $page->pageID)) . "?sp={$spNum}", $action);
}
}
$actions = '<ul id="pageHeading">' . $actions . '<li>';
if (isset($links)) {
$actions .= implode($links, ' | </li><li>') . '</li>';
}
return "{$actions}<li class=\"stats\">{$this->stats($page)}</li><li class=\"bottom\"></li></ul>";
}
示例8: actionLink
/**
*
*/
public function actionLink($content, $controller, $action, $data = array())
{
$data["controller"] = $controller;
$data["action"] = $action;
return "<a href=\"" . $this->view->url($data) . "\">{$content}</a>";
}
示例9: renderUrlWidget
/**
* Renders the url of the file
* @param $params
* @return string
*/
public function renderUrlWidget(array $params = array())
{
# Extract
$link = delve($params, 'link', false);
$file = delve($params, 'file', null);
$user = delve($params, 'user', null);
$content = delve($params, 'content', null);
$innerContent = delve($params, 'innerContent', null);
if ($content === $innerContent) {
$content = null;
}
$result = $text = $url = '';
$free = false;
# Handle
switch (true) {
case $file:
if (strstr($file, '/')) {
$text = basename($file);
} else {
# Resolve
if (!Bal_Doctrine_Core::isRecord('File', $file)) {
$file = Bal_Doctrine_Core::getItem('File', $file);
$free = $file;
}
# Check
if (!$file || !$file->id) {
break;
}
# Fetch
$text = $file->title;
}
$url = $this->view->url()->file($file)->toString();
break;
case $content:
# Resolve
if (!Bal_Doctrine_Core::isRecord('Content', $content)) {
$content = Bal_Doctrine_Core::getItem('Content', $content);
$free = $content;
}
# Check
if (!$content || !$content->id) {
break;
}
# Fetch
$text = $content->title;
$url = $this->view->url()->content($content)->toString();
break;
case $user:
# Resolve
if (!Bal_Doctrine_Core::isRecord('User', $user)) {
$user = Bal_Doctrine_Core::getItem('User', $user);
$free = $user;
}
# Check
if (!$user || !$user->id) {
break;
}
# Fetch
$text = $user->displayname;
$url = $this->view->url()->user($user)->toString();
break;
}
# Free
if ($free && FREE_RESOURCES) {
// $free->free(false);
}
# Prepare
if ($url) {
if ($link) {
if (!$text) {
$text = $innerContent;
}
$result = '<a href="' . $url . '">' . $text . '</a>';
} else {
$result = $url;
}
} else {
$result = '(link is dead)';
}
# Return result
return $result;
}
示例10: __toString
/**
* Returns the url as string.
*
* @return string
*/
public function __toString()
{
$query = count($this->queryParams) !== 0 ? '?' . http_build_query($this->queryParams) : '';
$anchor = $this->anchor === null ? '' : '#' . $this->anchor;
return $this->view->url($this->params, $this->route, $this->resetParams) . $query . $anchor;
}