Thread: Shop Discount
View Single Post
  #2  
Old 12-23-2014, 05:19 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,596
IntoRain is on a distinguished road
Default

I can't really test this, since my host is yet again down for maintenance, but did you try (purchase() in shopview.php):

PHP Code:
$shop_id $mysidia->input->get("shop");

//i'm not sure if input->get("shop") is the name or the sid. If it's the name, but you want the sid:

$shop = new Itemshop($mysidia->input->get("shop"));
$shop_id $shop->sid
In theory, you can access $mysidia->input->get("shop") from both sides (controller and view) since it's a variable sent by GET.

If you want to send a value from the controller to the view:

PHP Code:
//controller
$this->setField("discount", new Integer($discount));
//view
$discount $this->getField("discount")->getValue(); 
The getField is to retrieve the field from the hashmap (it's what's used to communicate variables between controller and view). The getValue is to get the internal value from the object (in this case the object is Integer and the value is an int)
__________________


asp.net stole my soul.

Last edited by IntoRain; 12-23-2014 at 05:32 PM.
Reply With Quote