Welcome Guest, Not a member yet? Register   Sign In
new to MVC
#6

[eluser]sofwan[/eluser]
Although a Controller is for logical and a View is for display, but a View can write for logical too but we keep to not so many put it there to keep MVC advantages and principles and that's one of CI for "You want a framework that does not require you to adhere to restrictive coding rules."

Actually if for one reason we put in a View so many logicals (controller) and Query (model) too, a program can still run well.But recommended only for certain reason.

For result an array and single variable, here is the example :

View : tampil_hasil.php

<?php

if ($negara=="No Country")
{ echo “Remark : $negara”; }
else
{
foreach ($data as $row)
{
// Our array put here
}
}
?>


Messages In This Thread
new to MVC - by El Forum - 07-01-2010, 11:56 PM
new to MVC - by El Forum - 07-02-2010, 01:21 AM
new to MVC - by El Forum - 07-02-2010, 01:34 AM
new to MVC - by El Forum - 07-02-2010, 02:12 AM
new to MVC - by El Forum - 07-02-2010, 03:05 AM
new to MVC - by El Forum - 07-02-2010, 10:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB