本文整理汇总了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();
}
示例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;
}
示例3: getUrl
/**
* {@inheritdoc}
*/
public function getUrl()
{
if ($this->resolver === null) {
$this->getResolver();
}
return parent::getUrl();
}
示例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());
}
示例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>';
}
}
示例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)));
}
示例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'));
}
}
示例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'));
}
}
示例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'));
}
}
示例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'));
}
}
示例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')));
}
}
示例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> </br>';
}
}
示例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)));
}
}
示例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');
}
示例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'));
}