Download the PHP package hashbang/urlopts without Composer

On this page you can find all versions of the php package hashbang/urlopts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package urlopts

URLopts - CodeIgniter pretty URL option processing

This library provies a simple way to setup nice looking URLs.

URLopts encodes various parameters into the URL string itself similar to a normal GET parameter but in a neater way.

For example the following URL shows the various components of a neatened URL:

http://website.com/controller/function/parameter1/value1/parameter2/value2/parameter3/value3

URLopts provides a library for constructing and reading back URLs such as this within a CodeIgniter controller.

Installation

Download this repo and copy into your application directory.

Alternatively, install with Composer.

Examples

CodeIgniter Controller

Here is a simple User controler which is showing a list of users.

This function allows you to pass various parameters in the URL to filter the user list.

For example the following URLs can be used

The example CodeIgniter controller would look something like this:

<?
class Users extends CI_Controller {

    function List() {
        $this->URLopts = new URLopts();

        // Setup various DB query parameters
        $offset = 0;
        $limit = 30;
        $where = array();

        $params = $this->URLopts->Get(); // Process this URL into an accessible array object of parameters

        if (isset($params['page'])) // Are we asking for a specific page (e.g. http://website.com/users/list/page/5)
            $offset = $limit * $params['page'];

        if (isset($params['newsletter']) && $params['newsletter']) // Are we only interested in users subscribed to a newsletter (e.g. http://website.com/users/list/newsletter/yes)
            $where['newsletter'] = 1;

        if (isset($params['role']) && $params['role']) // Are we only interested in users with a specific role (e.g. http://website.com/users/list/role/admin)
            $where['role'] = $params['role'];

        if (isset($params['recent']) && $params['recent']) // Are we only interested in users who have logged in recently (e.g. http://website.com/users/list/recent/yes)
            $where['lastlogin >='] = strtotime('-1 ' . $params['recent']);

        $this->load->view('users/header');
        $this->load->view('users/list', array(
            'users' => $this->User->GetAll($where, $limit, $offset), // This assumes you have a 'User' model with the function 'GetAll()'
            'limit' => $limit,
            'offset' => $offset,
            'params' => $params,
        ));
        $this->load->view('users/footer');
    }
}

CodeIgniter Views

This library also provides ways to return a URL with various options turned off/on.

For example these functions can be placed in your view to return the current URL again with various options set:

<?=$this->URLopts->Edit('foo=bar')?>

The above sets 'foo' to 'bar' in the URL. If the current URL was 'http://website.com/users/list' the above would return 'http://website.com/users/list/foo/bar'.

<?=$this->URLopts->Edit('+foo')?>

The above sets 'foo' to '1' in the URL. If the current URL was 'http://website.com/users/list' the above would return 'http://website.com/users/list/foo/1'.

<?=$this->URLopts->Edit('-foo')?>

The above removes 'foo' from the URL. If the current URL was 'http://website.com/users/list/foo/bar' the above would return 'http://website.com/users/list'.

An alternate syntax is also available:

<?=$this->URLopts->Add('foo', 'bar')?>

<?=$this->URLopts->Remove('foo')?>

All versions of urlopts with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hashbang/urlopts contains the following files

Loading the files please wait ....