Welcome Guest, Not a member yet? Register   Sign In
undefined variable (newbie)
#21

[eluser]langithitam[/eluser]
[quote author="xwero" date="1237901542"]It all depends on where you want to put the code. If you want only variables if possible in your views you can check the model method output in your controller and add the message there
Code:
$data['rows'] = $this->model->get_jobs();

if(count($data['rows']) == 0)
{
   $data['message'] = "No jobs today, it's the economy.";
}
But you can do this in your view too
Code:
&lt;?php if(empty($rows)): ?&gt;<p>No jobs today, it's the economy.</p>&lt;?php endif ?&gt;
If you do it in your view you don't have to deal with the message variable you pass to the view.[/quote]

ouuw thanks mate! you really enlight men Smile
#22

[eluser]Elegant Rao[/eluser]
my problem was solved by putting "@" before the variable in view file




Theme © iAndrew 2016 - Forum software by © MyBB