當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Url::getUrl方法代碼示例

本文整理匯總了PHP中Url::getUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Url::getUrl方法的具體用法?PHP Url::getUrl怎麽用?PHP Url::getUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Url的用法示例。


在下文中一共展示了Url::getUrl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: hashBang

 /**
  * Resolve an url with hashbang.
  *
  * @param Url $url
  *
  * @return string
  */
 protected static function hashBang(Url $url)
 {
     if ($path = preg_replace('|^(/?!)|', '', $url->getFragment())) {
         return $url->withPath($url->getPath() . $path)->getUrl();
     }
     return $url->getUrl();
 }
開發者ID:cienciastar,項目名稱:Embed,代碼行數:14,代碼來源:UrlRedirect.php

示例2: getList

 /**
  * retrieves a list from a database
  * @param array $searchcriteria supplied criteria
  * @param integer $pagesize size of result
  * @param integer $page offset
  * @param integer $order type of order
  * @return array
  */
 public function getList($searchcriteria = NULL, $pagesize = 0, $page = 1, $order = NULL)
 {
     $sqlParser = clone $this->sqlParser;
     $sqlParser->parseCriteria($searchcriteria);
     $this->parseCriteria($sqlParser, $searchcriteria);
     $sqlParser->setOrderby($this->getOrder($order));
     $query = $sqlParser->getSql(SqlParser::SEL_LIST);
     //if($sqlParser->getTable() == 'siteplugin') echo $query."<br />\n";
     //if($sqlParser->getTable() == 'users') Utils::debug($query);
     $db = $this->getDb();
     $this->pagerUrl->setParameter($this->getPagerKey(), '%d', false);
     //Pager replaces "%d" with the page number
     $this->pagerOptions['perPage'] = $pagesize;
     $this->pagerOptions['currentPage'] = $page;
     $this->pagerOptions['fileName'] = $this->pagerUrl->getUrl(false);
     $res = Pager_Wrapper_MDB2($db, $query, $this->pagerOptions, $pagesize == 0);
     if ($db->isError($res)) {
         throw new Exception($res->getDebugInfo());
     }
     // do postprocessing
     foreach ($res['data'] as &$item) {
         if (!$item) {
             continue;
         }
         $item['formatName'] = $this->formatName($item);
         $item = $this->handlePostGetList($item);
     }
     return $res;
 }
開發者ID:rverbrugge,項目名稱:dif,代碼行數:37,代碼來源:DbConnector.php

示例3: getUrl

 /**
  * {@inheritdoc}
  */
 public function getUrl()
 {
     if ($this->resolver === null) {
         $this->getResolver();
     }
     return parent::getUrl();
 }
開發者ID:SmartCrowd,項目名稱:Embed,代碼行數:10,代碼來源:Request.php

示例4: testExchangeArray

 /**
  * @covers StopIt\Model\Url::exchangeArray
  */
 public function testExchangeArray()
 {
     $this->emptyUrl->exchangeArray(array('Id' => 2, 'Url' => 'http://test.url', 'Updated' => '2015-06-25T00:07:00+0200'));
     $this->assertEquals(2, $this->emptyUrl->getId());
     $this->assertEquals('http://test.url', $this->emptyUrl->getUrl());
     $this->assertEquals('2015-06-25T00:07:00+0200', $this->emptyUrl->getUpdated());
 }
開發者ID:stop-it,項目名稱:server,代碼行數:10,代碼來源:UrlTest.php

示例5: getNext

 public function getNext()
 {
     if ($this->_offset < $this->_pages_count - 1) {
         echo '<li class="pagination-next"><a href="' . Url::getUrl('offset') . 'offset=' . ($this->_offset + 1) . '"></a></li>';
     } else {
         echo '<li class="pagination-next pagination-disabled"></li>';
     }
 }
開發者ID:alexposseda,項目名稱:events,代碼行數:8,代碼來源:pagination.class.php

示例6: deleteAction

 public function deleteAction()
 {
     $request = new Request();
     $id = $request->getParam('id');
     $Category = new Category();
     $Category->deleteCategory($id);
     header('location: ' . Url::getUrl('category', 'list', array('status' => 10)));
 }
開發者ID:Nefryt,項目名稱:mvc-app,代碼行數:8,代碼來源:categoryController.php

示例7: registerAction

 public function registerAction()
 {
     $Auth = new Auth();
     $post = $this->request->getPost();
     if (isset($post['username'])) {
         $Auth->register($post);
         header('Location:' . Url::getUrl('user', 'login'));
     }
 }
開發者ID:Cayman91,項目名稱:mvc,代碼行數:9,代碼來源:userController.php

示例8: addMarkiAction

 public function addMarkiAction()
 {
     $Marki = new Marki();
     $post = $this->request->getPost();
     if (isset($post['marka'])) {
         $Marki->addMarki($post['marka']);
         header('Location:' . Url::getUrl('marki', 'list'));
     }
 }
開發者ID:Cayman91,項目名稱:mvc,代碼行數:9,代碼來源:markiController.php

示例9: __construct

 public function __construct()
 {
     $this->request = new Request();
     $this->view = new View();
     $this->layout = new Layout();
     $this->debug = new Debug();
     if (!isset($_SESSION['login']) && ($this->request->getParam('action') !== 'login' && $this->request->getParam('action') !== 'register')) {
         header("Location:" . Url::getUrl('login', 'login'));
     }
 }
開發者ID:Nefryt,項目名稱:mvc-app,代碼行數:10,代碼來源:mainController.php

示例10: __construct

 public function __construct()
 {
     $this->request = new Request();
     $this->view = new View();
     $this->layout = new Layout();
     $this->userStorage = new UserStorage();
     if (!$this->userStorage->isAuthenticate() && $this->request->getParam('action') !== 'login' && $this->request->getParam('action') !== 'register') {
         header('Location: ' . Url::getUrl('user', 'login'));
     }
 }
開發者ID:Cayman91,項目名稱:mvc,代碼行數:10,代碼來源:mainController.php

示例11: usunAction

 public function usunAction()
 {
     $id = $this->request->getParam('id');
     $Marki = new Marki();
     if ($Marki->usunMarki($id)) {
         header('Location: ' . Url::getUrl('marki', 'wypisz', null));
     } else {
         $this->view->info = 'wystapil blad bazy danych';
         header('Location: ' . Url::getUrl('marki', 'wypisz', array('info' => 'wystapil blad bazy danych')));
     }
 }
開發者ID:6krecik,項目名稱:MVC,代碼行數:11,代碼來源:markiController.php

示例12: __construct

 public function __construct()
 {
     $this->request = new Request();
     $this->view = new View();
     $this->layout = new Layout();
     $this->UserStorage = new UserStorage();
     $this->layout->info = !empty($this->request->getParam('info')) ? $this->request->getParam('info') : null;
     $this->layout->UserStorage = $this->UserStorage;
     $controller = $this->request->getParam('controller');
     $action = $this->request->getParam('action');
     if (!$this->UserStorage->isAuthenticate() && $controller != 'user' && $action != 'wyswietlLogowanie' && $action != 'loguj' && $action != 'wyswietlRejestracje' && $action != 'rejestruj') {
         header('Location: ' . Url::getUrl('user', 'wyswietlLogowanie', array('info' => 'musisz sie zalogowac')));
     } else {
         //$this->layout->wyloguj='<a href="'.Url::getUrl( 'user', 'wyloguj', null  ).'">wyloguj</a>&nbsp;</br>';
     }
 }
開發者ID:6krecik,項目名稱:MVC,代碼行數:16,代碼來源:mainController.php

示例13: editAction

 public function editAction()
 {
     $Car = new Cars();
     $this->view->data = $Car->getCategory();
     $new_model = $this->request->getPost('model');
     $new_marka = $this->request->getPost('marka_id');
     $new_opis = $this->request->getPost('opis');
     $id = $this->request->getPost('id');
     $is_photo = $this->request->getFiles('zdjecie');
     if ($new_model == NULL && $new_marka == NULL && $new_opis == NULL && $is_photo == NULL) {
         $this->view->display('edit');
     } else {
         $Car->updateCar($new_model, $new_marka, $new_opis, $is_photo, $id);
         header('location:' . Url::getUrl('car', 'list', array('status' => 6)));
     }
 }
開發者ID:Nefryt,項目名稱:mvc-app,代碼行數:16,代碼來源:carController.php

示例14: registerAction

 public function registerAction()
 {
     $user = new Register();
     $email = $this->request->getPost('email');
     $login = $this->request->getPost('login');
     $password = md5($this->request->getPost('password'));
     if ($email == NULL && $login == NULL && $password == NULL) {
     } else {
         if ($email == NULL || $login == NULL || $password == NULL) {
         } else {
             if ($user->saveUser($email, $login, $password)) {
                 header('location=' . Url::getUrl('login', 'login', array('status' => 4)));
             } else {
                 header('location=' . Url::getUrl('register', 'register', array('status' => 5)));
             }
         }
     }
     $this->view->display('register_form');
 }
開發者ID:Nefryt,項目名稱:mvc-app,代碼行數:19,代碼來源:registerController.php

示例15: updateAutoAction

 public function updateAutoAction()
 {
     $Cars = new Cars();
     $post = $this->request->getPost();
     if (isset($post['nazwaAuta'])) {
         $image = $this->request->getFiles('zdjecie');
         $config = Config::getInstance();
         $config = $config->getConfig();
         $plik = uniqid();
         if ($image['error'] == 0) {
             $e = pathinfo($image['name']);
             $extension = $e['extension'];
             $img = WideImage::load($image['tmp_name']);
             $resized = $img->resize(100, 100);
             $resized->saveToFile($config['IMG_DIR'] . '/small_' . $plik . '.' . $extension);
             move_uploaded_file($image['tmp_name'], $config['IMG_DIR'] . $plik . '.' . $extension);
             $post['zdjecie'] = $plik . '.' . $extension;
         }
         $Cars->editSamochody($post);
     }
     header('Location:' . Url::getUrl('cars', 'list'));
 }
開發者ID:Cayman91,項目名稱:mvc,代碼行數:22,代碼來源:carsController.php


注:本文中的Url::getUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。