Welcome, Guest
Username: Password: Remember me

TOPIC: Parsing a value with setRedirect()

Parsing a value with setRedirect() 11 Apr 2012 06:53 #1971

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
In a controller 'property' i have a savebooking option. In that controller i save several records, also one record in the table booking. After saving the record i redirect to a thankyou layout of the booking table.
$vars = array();
	   JRequest::setVar( 'view'  , 'bookingitem');
           JRequest::setVar( 'layout', 'bookingthankyou' );
           JRequest::setVar( 'cid', $model_bookingitem->_id );

           $this->setRedirect(Mw1bookingHelper::urlRequest($vars));

In the cid i parse the id of the new bookingitem record with $model_bookingitem->_id. The url is then like bookingitem/bookingthankyou?lang=&cid[0]=96

What i do not want is the cid[0]=96 part. How can i parse a variable with the $model_bookingitem->_id without showing this variable in the url, the url would then be: bookingitem/bookingthankyou?lang=

Is this possible? If yes, how to?
Molenwal1 Webdesign
www.molenwal1.nl
The administrator has disabled public write access.

Re: Parsing a value with setRedirect() 18 Apr 2012 08:19 #2047

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
Maybe someone can explain me how i am able to change the url to a SEO url, for example it is now:
www.zomerhuisjebythesea.nl/bezetting-res...king/subpropertyitem

www.zomerhuisjebythesea.nl => the domain name
bezetting-reserveren => menu title
1 => id of the subpropertyitem
subpropertybooking => layout (of j-cook component)
subpropertyitem => view (of j-cook component)

I would love to sea something like:
www.zomerhuisjebythesea.nl/bezetting-reserveren/<Title of the subpropertyitem>

<Title of the subpropertyitem> is a field title in the table subproperty.

Is that possible? Is there any documentation about this?
Molenwal1 Webdesign
www.molenwal1.nl
The administrator has disabled public write access.

Re: Parsing a value with setRedirect() 19 Apr 2012 06:37 #2051

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
It looks you are talking about settings in Joomla admin->Global Configuration->SEO Settings
Last Edit: 19 Apr 2012 06:37 by etc.
The administrator has disabled public write access.

Re: Parsing a value with setRedirect() 19 Apr 2012 08:23 #2053

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
No, everything is set correctly for SEO . I am also using AceSEF of JoomAce.

In AceSEF i have set to use the component router for my component. I think it is a combination of AceSEF and SEO. I will look further into this.
Molenwal1 Webdesign
www.molenwal1.nl
Last Edit: 19 Apr 2012 08:23 by molenwal1.
The administrator has disabled public write access.

Re: Parsing a value with setRedirect() 19 Apr 2012 08:47 #2055

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
To handle special vars of your specific extension, you have to make the changes in the router.php file of your component (front).

xxxxBuildRoute(&$query) : Encode URL
xxxxParseRoute($segments) : Decode URL
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Parsing a value with setRedirect() 04 May 2012 05:28 #2230

  • etc
  • etc's Avatar
  • Offline
  • Premium Member
  • Posts: 132
  • Thank you received: 19
  • Karma: 7
Maybe it is same issue.
Anyway, I have own form that only posts "datefrom" and "dateto" variables from calendar, this works well.
When I turn on SEO I can not retrieve date variable from POST.

So I registred date variable in heper(admin site)
$authorizedInUrl = array('option', 'view', 'layout', 'Itemid', 'tmpl', 'datefrom', 'dateto')

It helped and it works again but SEO URL is not completely nice, actualy that part I added.
I would like to hide the datefrom and dateto variables in URL.
www.something.com/something/something/so...16&dateto=2012-05-04

What are the next steps to achieve that?
router.php
maybe in tmpl/some layout
.
.

I believe this is possible to hide it but I still do not know how.
Any idea?

thanks
The administrator has disabled public write access.
The following user(s) said Thank You: admin
Time to create page: 0.101 seconds

Get Started