Post by mykingla » Fri Dec 12, 2008 9:44 am

http://localhost/news/100

How to get the two parameters news and 100 in the url.

I just know only a little.

Can anyone tell the detail process?  :)

New member

Posts

Joined
Wed Dec 03, 2008 10:45 am

Post by Qphoria » Fri Dec 12, 2008 10:10 am

$request->gethtml('controller') should be 'news'
$request->gethtml('product_id') should be '100' (might be any id.. category_id, information_id, etc. depending on the page being opened)

you should be able to see what's in the $_REQUEST server variable by using:

in any of the tpl files. Use it at the top of layout.tpl to see what available on certain pages.
Last edited by Qphoria on Fri Dec 12, 2008 10:13 am, edited 1 time in total.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mykingla » Fri Dec 12, 2008 10:48 am

I always use $url->href to pass the parameter

New member

Posts

Joined
Wed Dec 03, 2008 10:45 am

Post by mykingla » Fri Dec 12, 2008 10:55 pm

When I use the gethtml function

Fatal error: Call to undefined method Request::gethtml() in

But if I use $request->get('controller'), that's ok..
Last edited by mykingla on Fri Dec 12, 2008 10:58 pm, edited 1 time in total.

New member

Posts

Joined
Wed Dec 03, 2008 10:45 am

Post by Qphoria » Fri Dec 12, 2008 11:57 pm

gethtml was added in 0.7.9RC4. if you are using an older version then you need to change it to "get", but be warned that it could lead to display of html tags on descriptions

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 5 guests