I have a url that looks like this:
Code: Select all
http:.../index.php?route=services/order&height=8&width=10
So far I have:
Code: Select all
<?php
class ControllerServicesOrder extends Controller {
public function index() {
$this->language->load('services/order');
$this->document->title = $this->language->get('heading_title');
IF ($this->request->server['REQUEST_METHOD'] == 'GET') {
$this->request->get['height'];
$this->request->get['width'];
if(($height) or ($width) == NULL))
{$area = 0;}
ELSE {$this->$area = $height*$width;}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/services/order.tpl')) {
$this->template = $this->config->get('config_template') . '/template/services/order.tpl';
} else {
$this->template = 'default/template/services/order';
}
}
?>
Looking at all the online tutorials I see examples of declaring variables and giving them values in the CLASS, What good is that? I've been looking to find out how to pass $_GET data to the CLASS, do arithmetic or logical operations on it and output it back to the template.
Can anyone tell me what is wrong with my Class or URL ?
-Harry