Structures_DataGrid::setUrlFormat() – Enable and configure URL mapping


require_once 'Structures/DataGrid.php';

void Structures_DataGrid::setUrlFormat ( mixed $format , string $prefix = null , string $scriptname = null )


If this is set, it will be parsed instead of GET/POST. This is only supported on PHP5, as it depends on Net_URL_Mapper.

There are three possible placeholders, :pager, :orderBy and :direction. :page or (:orderBy and :direction) can be used alone.

It is possible to use multipe DataGrid instances on one page with different prefixes.

Instead of a format string you might also pass a Net_URL_Mapper instance to this method, in which case $prefix and $scriptname will be ignored. This instance must be properly set up, connected to url patterns, etc... This is especially useful when you've already configured URL mapping globally for your application and want Structures_DataGrid to integrate.


mixed $format

The URL format string or a Net_URL_Mapper instance

string $prefix

Sets the url prefix

string $scriptname

Set the scriptname if mod_rewrite not available


throws Net_URL_Mapper_InvalidException


configure a url format


// identical, for example /page/5/foo/ASC

// without /page, for example /5/foo/ASC

// without paging, for example /sort/foo/ASC

// with scriptname, for example /index.php/5/foo/ASC



This function can not be called statically.

Set the global GET/POST variables prefix (Previous) Sorts the records by the defined field. (Next)
Last updated: Tue, 24 Nov 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.