I have this code in my CI controller.
public function edit($id = '')
{
$this->load->helper("form");
$this->load->library("form_validation");
$data["title"] = "Edit category";
$this->form_validation->set_rules('category_name', 'Category name', 'required');
if (!$this->form_validation->run())
{
$data['category'] = $this->categories_model->get_categories($id);
$this->load->view("templates/admin_header", $data);
$this->load->view("categories/edit", $data);
$this->load->view("templates/admin_footer", $data);
}
else
{
$this->categories_model->update($id);
// other logic
}
}
If the form is submited, it updates the category. If I load the page /categories/edit/32 it shows me the info for the category.
I develop with Netbeans and XDebug. My problem here is that when I put a break point on the first line of the function, the debugger returns three times on the break point. I load the page /categories/edit/32 and the debugger stops at the first line om the break point. I press F5 to continue, it loads the function for the second time. I press F5 again, it loads the function for the third and last time. What can cause this? Is this some bug in Netbeans or XDebug, or I have some bug that I can't see?
EDIT:
I have this .htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|include|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
I've found that the problem is in one jQuery plugin that preloads all the images from all the css files. All the images that are preloaded are inside the images folder. If I remove the plugin, it works fine.