[eluser]Zack Kitzmiller[/eluser]
Code:
function view($username){
$this->load->model('dealers_model', 'dealers', TRUE);
$view_data['username'] = $username;
$view_data['title1'] = "Dealer";
$view_data['title2'] = "Profile";
$view_data['title'] = "Dealer Profile";
$view_data['body'] = "dealerpage";
$view_data['dealers'] = $this->dealers->getAllDealers();
$view_data['featured'] = $this->profile_model->getFeaturedVehiclesByUser();
$view_data['view_file'] = 'dealers';
if ( $username === FALSE )
{
redirect('profile');
}
$view_data = array();
$view_data['profile'] = $this->profile_model->get_single_profile($username);
if ( $view_data['profile'] === FALSE )
{
redirect('profile');
}
$view_data['view_file'] = 'profile/view';
$this->load->view('layout', $view_data);
}
This is really here nor there, but it would be beneficial to call
Code:
if ( $username === FALSE )
{
redirect('profile');
}
Before anything else in your controller. 1st, you're gonna get a notice about setting $data['username'] = $username, and why bother wasting the memory to fill that array is you're just going to destroy it anyway?