Ok, so the problem goes as follows. i have a simple zend framework 2 app with a module router, controllers and views, i can view a table from a page, select to either add edit or delete an item from said table. as far as ADD and EDIT goes, the code works like a charm, now, when i want to DELETE something, it just outputs the following:
Zend\View\Renderer\PhpRenderer::render: Unable to render template "system/system/delete"; resolver could not resolve to a file
which makes absolutely NO SENSE as the file IS present on the folder, and avery other view URL that i visit using my browser works OK all views (ADD, EDIT, and INDEX) works OK, no problem at all, how can the program be telling me that a file, that is clearly present, just sitting there next to the other files i have been using so far "DOES NOT EXIST".
This is my folder estructure:
As you can see All view are in the same folder, all the other views that i call from url do open and work correctly. so why does this one not work ?.
My controller has the following delete action:
public function deleteAction()
{
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) {
return $this->redirect()->toRoute('system');
}
$request = $this->getRequest();
if ($request->isPost()) {
$del = $request->getPost('del', 'No');
if ($del == 'Yes') {
$id = (int) $request->getPost('id');
$this->getUserTable()->deleteUser($id);
}
// Redirect to list of System
return $this->redirect()->toRoute('system');
}
return array(
'id' => $id,
'system' => $this->getUserTable()->getUser($id)
);
}
And this is the code for the delete view:
<?php
$title = 'Delete user';
$this->headTitle($title);
?>
<h1><?php echo $this->escapeHtml($title); ?></h1>
<div>
<p>Are you sure that you want to delete </p>
<p> Username: '<?php echo $this->escapeHtml($system->username); ?>'
First name: '<?php echo $this->escapeHtml($system->fisrt_name); ?>'?
</p>
</div>
<?php
$url = $this->url('system', array(
'action' => 'delete',
'id' => $this->id,
));
?>
<form action="<?php echo $url; ?>" method="post">
<div>
<input type="hidden" name="id" value="<?php echo (int) $system->id; ?>" />
<input type="submit" name="del" value="Yes" />
<input type="submit" name="del" value="No" />
</div>
</form>
I keep looking at the code but i'm just helpless, i cant see to find any problem with it or why is this happening, which is making me feel realy mad, so i call upon your "l33t haxxor" coding knowledge to solve this one out.
Thanks in advance.