Welcome Guest, Not a member yet? Register   Sign In
What goes where? (MVC)
#6

[eluser]SomeFunkyDude[/eluser]
OK, it's starting be a little clearer for me now, the Controller is JUST the traffic cop, any classes/functions/processing/logic/database processing, etc. should be in the model, the view should mostly be html, basic data displaying templates, or simple loop or if/else statements.

On a side note...
[quote author="richthegeek" date="1239319769"]
function view( $id = false )
{
if( !$id ) redirect( "home" );

$product = $this->product->get_all_data( $id );
$user = $this->user->get_user_info();
$cart = $this->cart->get_cart_array();
$categories = $this->categories->get_children( 0 ); /* imagine the 0 is the root node .[/quote]
Can you assign the Boolean 'false' to $id in the method's arguments, and wouldn't that always make if(!$id) return false thus always redirecting to the home page.

Also, in the line:
Code:
$product = $this->product->get_all_data($id)
this wouldn't work unless the controller also loaded a model that has property of 'product' and method of 'get_all_data()' right?


Messages In This Thread
What goes where? (MVC) - by El Forum - 04-09-2009, 11:30 AM
What goes where? (MVC) - by El Forum - 04-09-2009, 11:40 AM
What goes where? (MVC) - by El Forum - 04-09-2009, 12:03 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 12:29 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 01:26 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 01:42 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 01:50 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 01:57 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 02:07 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 02:08 PM
What goes where? (MVC) - by El Forum - 04-09-2009, 03:59 PM
What goes where? (MVC) - by El Forum - 05-22-2009, 10:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB