当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_View_Interface::url方法代码示例

本文整理汇总了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');
 }
开发者ID:Konstnantin,项目名称:zf-app,代码行数:14,代码来源:Menu.php

示例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;
 }
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:21,代码来源:ColumnSort.php

示例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}>";
 }
开发者ID:humansky,项目名称:qframe,代码行数:25,代码来源:Form.php

示例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;
 }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:33,代码来源:MenuYUIHTML.php

示例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;
    }
开发者ID:BGCX262,项目名称:zym-svn-to-git,代码行数:37,代码来源:MenuYUIJS.php

示例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;
 }
开发者ID:humansky,项目名称:qframe,代码行数:24,代码来源:ApplicationHelpers.php

示例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>";
 }
开发者ID:humansky,项目名称:qframe,代码行数:27,代码来源:PageHelpers.php

示例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>";
 }
开发者ID:smalyshev,项目名称:chgk-teams,代码行数:9,代码来源:ActionLink.php

示例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;
 }
开发者ID:balupton,项目名称:balcms,代码行数:87,代码来源:Content.php

示例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;
 }
开发者ID:matthimatiker,项目名称:molcomponents,代码行数:11,代码来源:Url.php


注:本文中的Zend_View_Interface::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。