Home » Structures » Structures_DataGrid » Bug #9994
Clean URLs and parsing HTTP requests with Seagull
Details
| Request #9994 | Clean URLs and parsing HTTP requests with Seagull |
|---|---|
| Submitted | 2007-02-01 01:11 UTC |
| From | f dot geelhoed at gmail dot com |
| Assigned | olivierg |
| Status | Closed |
| Package | Structures_DataGrid |
| PHP Version | 5.1.0 |
| OS | winXP |
| Roadmaps | (Not assigned) |
Comments
[2007-02-01 01:11 UTC] f dot geelhoed at gmail dot com
Description:
------------
I am currently implementing a Datagrid component in the Seagull framework (seagullproject.org).
I use a search engine friendly url strategy resulting in urls like:
http://dev.mydomain.lan/datagrid/action/try1/
I use the Pager Renderer for paging the datagrid. To match the urls used in the framework I had the options to configure the url like in CODE SNIPPET 1.
I am wondering if any plans exist for implementing this sort of configuration options in the Datagrid Renderer strategy.
I can imagine something like code snippet 2.
In combination with a few functions like in code snippet 3.
Seagull among other frameworks/CMS empties the $_REQUEST and $_GET which are now used to interpret the request and generate sorting urls.
The url generation I simply solved by subclassing the HTMLTable renderer. But manually inserting values into the $_GET and $_REQUEST can't be the way to go?
Any response is appreciated : )
Test script:
---------------
// CODE SNIPPET 1
$tableOptions = array(
// other options
'sortingResetsPaging' => false,
// set request url without
'selfPath' => SGL_URL::makeLink('try1', 'datagrid', 'datagrid', array(),''),
'fileName' => '/orderBy/%o/direction/%d/page/%p/'
);
// Output table and paging links
$test = $datagrid->render('SGLHTMLTable', $tableOptions);
// CODE SNIPPET 2
$options = array(
'pagerOptions' => array(
// other options ...
'append' => false,
'fileName' => '/page/%d/', // To get Seagull URL Style working for Pager
'path' => 'http://dev.mydomain.lan/datagrid/datagrid/action/try1/',
'currentPage' => $req->get('page'),
)
);
$test = $datagrid->render(DATAGRID_RENDER_PAGER, $options);
// CODE SNIPPET 3
$datagrid->setCurrentPage();
$datagrid->setDirection();
$datgrid->setCurrentPage();
[2007-02-20 20:18 UTC] olivierg at php dot net
Let's clarify a few things first. You say:
> I use the Pager Renderer for paging the datagrid.
> To match the urls used in the framework I had the
> options to configure the url like in CODE SNIPPET 1.
Don't you mean "CODE SNIPPET 2"?
> I am wondering if any plans exist for implementing
> this sort of configuration options in the Datagrid
> Renderer strategy. I can imagine something like
> code snippet 2.
Don't you mean "CODE SNIPPET 1"?
Couldn't you please post on http://phpfi.com (or somewhere else) the driver you wrote by subclassing the HTMLTable renderer? That would help us to understand your need.
Btw, your request subject wasn't complete. I allowed myself to change it.