For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > January 2005 > QuickFrom Controller URL big problems









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author QuickFrom Controller URL big problems
PHPDiscuss - PHP Newsgroups and mailing lists

2005-01-26, 8:57 am

First of all, I'd like to thank everybody, Justin, Alexey ... for their
help and their job on Pear packages.

I'm starting a project with DB, DataObject, Datagrid, Quick Form
Controller, perhaps FormBuilder and others... and I really want to go on
with this because I think I'll save a lot of time and I'll keep it for the
logic process which is much more important i think ...

I still have some technical problems but I'm keeping the faith, ans I
search in the initial code and on posts in the mailing ... :)

One of these big problems is about Quickform Controller, I already post
some questions about these but with no response.
And I' really think that other persons had or will have the same problems.

Actually, i'd would like to keep my current URL query string (parameters
and values when i go to a QFC multi-page first page) whatever I do with
the QFC on validation, on submission in a
wizard with next and back action ...

ex: the url for going to my first page of a QFC is

http://localhost/index2.php?mod=admin&act=insert

and I *MUST* keeping this parameters (mod and act) url all the time !

But after validation and click on the next button to go to the second page
or if i do server validation rules before or if i submit and process the
second page of QFC, the initial parameters are erased and i got :

http://localhost/index2.php?_qf_page2_display=true

ok but why can't QFC keep it ? (a lot of web site use no frames and need
url parameters from page to page).
I saw a tip for QF package
http://pear.php.net/manual/en/packa...aq.php#AEN41974
but I think it's another thing.

So, i've tried the method in the QFC faq :

1-on the first page of the controller :

$data =& $this->controller->container();
$data['_url_param'] = $my_initial_query_string;

2-on the jump.php file i put :

$data =& $page->controller->container();

and replace the last line with :
header('Location: ' . $url . '&' . $data['_url_param']);

Am i right ?

BUT, when the form is not valid with serv_side validation and i do some
action, it disappear.
Idem for submission and process of data in the last page of the QFC.

Is it possible to have a quick example of code, I will really help.

thx !

JP.Dumont
Ignatius Reilly

2005-01-26, 3:57 pm

You CAN'T keep the URL parameters at all times with QFC.

You have usually two kinds of parameters:
- the "framework" parameters (descriptors of a page, like
"section=admin" or "pageid=123")
- the "form" parameters passed to the page (like "n=1")

Concerning the "framework" parameters, there is simply no way to use QFC
unless you implement some URL rewriting (f it is an option for you)
instead of:
http://localhost/index2.php?mod=admin&act=insert
having:
http://localhost/admin/index2.php?act=insert or such

Now for the "form" parameters, when they appear simply store them in the
container for use during the process action.

HTH
Ignatius


PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> First of all, I'd like to thank everybody, Justin, Alexey ... for their
> help and their job on Pear packages.
>
> I'm starting a project with DB, DataObject, Datagrid, Quick Form
> Controller, perhaps FormBuilder and others... and I really want to go on
> with this because I think I'll save a lot of time and I'll keep it for the
> logic process which is much more important i think ...
>
> I still have some technical problems but I'm keeping the faith, ans I
> search in the initial code and on posts in the mailing ... :)
>
> One of these big problems is about Quickform Controller, I already post
> some questions about these but with no response.
> And I' really think that other persons had or will have the same problems.
>
> Actually, i'd would like to keep my current URL query string (parameters
> and values when i go to a QFC multi-page first page) whatever I do with
> the QFC on validation, on submission in a
> wizard with next and back action ...
>
> ex: the url for going to my first page of a QFC is
>
> http://localhost/index2.php?mod=admin&act=insert
>
> and I *MUST* keeping this parameters (mod and act) url all the time !
>
> But after validation and click on the next button to go to the second page
> or if i do server validation rules before or if i submit and process the
> second page of QFC, the initial parameters are erased and i got :
>
> http://localhost/index2.php?_qf_page2_display=true
>
> ok but why can't QFC keep it ? (a lot of web site use no frames and need
> url parameters from page to page).
> I saw a tip for QF package
> http://pear.php.net/manual/en/packa...aq.php#AEN41974
> but I think it's another thing.
>
> So, i've tried the method in the QFC faq :
>
> 1-on the first page of the controller :
>
> $data =& $this->controller->container();
> $data['_url_param'] = $my_initial_query_string;
>
> 2-on the jump.php file i put :
>
> $data =& $page->controller->container();
>
> and replace the last line with :
> header('Location: ' . $url . '&' . $data['_url_param']);
>
> Am i right ?
>
> BUT, when the form is not valid with serv_side validation and i do some
> action, it disappear.
> Idem for submission and process of data in the last page of the QFC.
>
> Is it possible to have a quick example of code, I will really help.
>
> thx !
>
> JP.Dumont

Ignatius Reilly

2005-01-26, 3:57 pm

You CAN'T keep the URL parameters at all times with QFC.

You have usually two kinds of parameters:
- the "framework" parameters (descriptors of a page, like
"section=admin" or "pageid=123")
- the "form" parameters passed to the page (like "n=1")

Concerning the "framework" parameters, there is simply no way to use QFC
unless you implement some URL rewriting (f it is an option for you)
instead of:
http://localhost/index2.php?mod=admin&act=insert
having:
http://localhost/admin/index2.php?act=insert or such

Now for the "form" parameters, when they appear simply store them in the
container for use during the process action.

HTH
Ignatius


PHPDiscuss - PHP Newsgroups and mailing lists wrote:
> First of all, I'd like to thank everybody, Justin, Alexey ... for their
> help and their job on Pear packages.
>
> I'm starting a project with DB, DataObject, Datagrid, Quick Form
> Controller, perhaps FormBuilder and others... and I really want to go on
> with this because I think I'll save a lot of time and I'll keep it for the
> logic process which is much more important i think ...
>
> I still have some technical problems but I'm keeping the faith, ans I
> search in the initial code and on posts in the mailing ... :)
>
> One of these big problems is about Quickform Controller, I already post
> some questions about these but with no response.
> And I' really think that other persons had or will have the same problems.
>
> Actually, i'd would like to keep my current URL query string (parameters
> and values when i go to a QFC multi-page first page) whatever I do with
> the QFC on validation, on submission in a
> wizard with next and back action ...
>
> ex: the url for going to my first page of a QFC is
>
> http://localhost/index2.php?mod=admin&act=insert
>
> and I *MUST* keeping this parameters (mod and act) url all the time !
>
> But after validation and click on the next button to go to the second page
> or if i do server validation rules before or if i submit and process the
> second page of QFC, the initial parameters are erased and i got :
>
> http://localhost/index2.php?_qf_page2_display=true
>
> ok but why can't QFC keep it ? (a lot of web site use no frames and need
> url parameters from page to page).
> I saw a tip for QF package
> http://pear.php.net/manual/en/packa...aq.php#AEN41974
> but I think it's another thing.
>
> So, i've tried the method in the QFC faq :
>
> 1-on the first page of the controller :
>
> $data =& $this->controller->container();
> $data['_url_param'] = $my_initial_query_string;
>
> 2-on the jump.php file i put :
>
> $data =& $page->controller->container();
>
> and replace the last line with :
> header('Location: ' . $url . '&' . $data['_url_param']);
>
> Am i right ?
>
> BUT, when the form is not valid with serv_side validation and i do some
> action, it disappear.
> Idem for submission and process of data in the last page of the QFC.
>
> Is it possible to have a quick example of code, I will really help.
>
> thx !
>
> JP.Dumont

PHPDiscuss - PHP Newsgroups and mailing lists

2005-01-27, 8:56 am

Ignatius Reilly wrote:

> You CAN'T keep the URL parameters at all times with QFC.


> You have usually two kinds of parameters:
> - the "framework" parameters (descriptors of a page, like
> "section=admin" or "pageid=123")
> - the "form" parameters passed to the page (like "n=1")


> Concerning the "framework" parameters, there is simply no way to use QFC
> unless you implement some URL rewriting (f it is an option for you)
> instead of:
> http://localhost/index2.php?mod=admin&act=insert
> having:
> http://localhost/admin/index2.php?act=insert or such


> Now for the "form" parameters, when they appear simply store them in the
> container for use during the process action.


> HTH
> Ignatius


[color=darkred]
> PHPDiscuss - PHP Newsgroups and mailing lists wrote:
http://pear.php.net/manual/en/packa...aq.php#AEN41974[color=darkred]

Ok, I give up.
I've done a mix with sessions and request glob var. It works.

Alexey your advice is a good idea but doesn't work (the jump action
eraises the querystring url with a header). I also tried to change the QF
contructor and action attribute but it fails.

I really can't find why it doesn't work and i'm getting mad :)

Thx for all.
JP Dumont
PHPDiscuss - PHP Newsgroups and mailing lists

2005-01-27, 8:56 am

Ignatius Reilly wrote:

> You CAN'T keep the URL parameters at all times with QFC.


> You have usually two kinds of parameters:
> - the "framework" parameters (descriptors of a page, like
> "section=admin" or "pageid=123")
> - the "form" parameters passed to the page (like "n=1")


> Concerning the "framework" parameters, there is simply no way to use QFC
> unless you implement some URL rewriting (f it is an option for you)
> instead of:
> http://localhost/index2.php?mod=admin&act=insert
> having:
> http://localhost/admin/index2.php?act=insert or such


> Now for the "form" parameters, when they appear simply store them in the
> container for use during the process action.


> HTH
> Ignatius


[color=darkred]
> PHPDiscuss - PHP Newsgroups and mailing lists wrote:
http://pear.php.net/manual/en/packa...aq.php#AEN41974[color=darkred]

Ok, I give up.
I've done a mix with sessions and request glob var. It works.

Alexey your advice is a good idea but doesn't work (the jump action
eraises the querystring url with a header). I also tried to change the QF
contructor and action attribute but it fails.

I really can't find why it doesn't work and i'm getting mad :)

Thx for all.
JP Dumont
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com