Reputation: 327
I'm new to opencart MVC is it possible to send view data like this
<p><?php echo "$i )".$showall['store_name']. '<br>'.$showall['store_address'].'<br>'. $showall['zipcode'].'<br>'.$showall['zipcode'].'<br>'.$showall['city'].'<br><a href='.$delaction.'>Delete</a>' ; ?> </p>
here I would like to send $delcation variable to controller
Upvotes: 1
Views: 1215
Reputation: 1
In your controller file use $data[] global variable to send data to view
Ex: In controller file $data['var_name']="something";
In view file you can use it has <?php echo $var_name; ?>
Upvotes: 0
Reputation: 76
I'm not familiar with opencart, but I'm with MVC. In some frameworks you have a routes file, in others the framework interprets your controller structure to provide routes. I'm assuming opencart works like the last.
You have a controller with an index function right? And to load that page via the url, something like: "http://localhost/index.php?route=test/abc"
You can try the following:
What to do if "index.php?route=test/abc/delete" doesn't work? If opencart doesn't support this you can do the following:
Hope it works out for you! (let me know what helped, so I can update the answer accordingly)
Upvotes: 1