public function setReferURL($url = null)
 {
     if (empty($url)) {
         $url = \ORC\Util\Url::getCurrentURL(true);
     }
     $this->set(self::refer, $url);
 }
 public function generateURL($action_name = null, array $params = array())
 {
     return \ORC\Util\Url::generateURL($action_name, $params);
 }
 private function prepareReservedVariable($name)
 {
     $output = '';
     $cache_buster = Config::getInstance()->get('template.cache_buster');
     if ($cache_buster == '') {
         $cache_buster = \ORC\Util\Util::getNow();
     }
     switch ($name) {
         case 'js':
             //first get the template js
             $existing_jses = array();
             $jses = array_merge($this->_jses, $this->getViewModel()->getAllJs());
             //pre($jses, $this->_jses);
             foreach ($jses as $path) {
                 if (in_array($path, $existing_jses)) {
                     continue;
                 }
                 $existing_jses[] = $path;
                 $path = Url::getFullHttpPath($path);
                 $output .= sprintf('<script type="text/javascript" src="%s?%s"></script>', $path, $cache_buster);
             }
             break;
         case 'css':
             $existing_csses = array();
             $csses = array_merge($this->_csses, $this->getViewModel()->getAllCss());
             foreach ($csses as $css) {
                 if (!isset($existing_csses[$css['media']])) {
                     $existing_csses[$css['media']] = array();
                 }
                 if (in_array($css['path'], $existing_csses[$css['media']])) {
                     continue;
                 }
                 $existing_csses[$css['media']][] = $css['path'];
                 $css['path'] = Url::getFullHttpPath($css['path']);
                 $output .= sprintf('<link type="text/css" rel="stylesheet" href="%s?%s" media="%s" />', $css['path'], $cache_buster, $css['media']);
             }
             break;
         case 'raw_js':
             $output .= implode("\n", $this->_viewModel->getRawJs());
             break;
         case 'raw_css':
             $output .= implode("\n", $this->_viewModel->getRawCss());
             break;
         case 'title':
             $output .= $this->getViewModel()->getTitle();
             break;
     }
     return $output;
 }
 protected function renderNextLink($action_name, array $params, \ORC\Util\Pagination $pagination)
 {
     if ($pagination->getPage() == $pagination->getTotalPage()) {
         return sprintf('<li class="disabled"><span aria-hidden="true">&raquo;</span></li>');
     } else {
         return sprintf('<li><a href="%s" aria-label="后一页"><span aria-hidden="true">&raquo;</span></a></li>', Url::generateURL($action_name, $params + array('page' => $pagination->getPage() + 1)));
     }
 }