当前位置: 首页>>代码示例>>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;未经允许,请勿转载。