Hi all guys,
I want to do, for the administrators, a page where are displayed all the "routes" regarding the pages etc.
This is the html markup:
<?php
/**
* @var IV_View_Base $this
*/
?>
<table class="table table-bordered" width="100%">
<tr>
<td>
<table width="100%">
<tr>
<th width="13%">Path</th>
<th width="13%">Module</th>
<th width="13%">Controller</th>
<th width="13%">Action</th>
<th width="13%">Access Role</th>
<th width="13%">Compare Operator</th>
<th width="9%">Submit</th>
</tr>
</table>
</td>
</tr>
<?
$aRoutes = $this->getValue( 'aRoutes' );
if( count( $aRoutes ) == 0 ) { ?>
<tr>
<td colspan="6">No routes found!</td>
</tr>
<? } else {
/**
* @var Default_Model_RouteEntity $oRoute
*/
foreach( $aRoutes as $oRoute ) {?>
<tr><td>
<form method="POST" id="my_form"></form>
<table width="100%">
<td width="13%">
<input type="text" value="<?=$oRoute->getPath(); ?>" />
</td><td width="13%">
<input type="text" value="<?=$oRoute->getModule(); ?>" />
</td><td width="13%">
<input type="text" value="<?=$oRoute->getController(); ?>" />
</td><td width="13%">
<input type="text" value="<?=$oRoute->getAction(); ?>" />
</td><td width="13%">
<input type="text" value="<?=$oRoute->getAccessRole(); ?>" />
</td><td width="13%">
<input type="text" value="<?=$oRoute->getRoleCompareOperator(); ?>" />
</td><td width="9%">
<button type="button" class="btn btn-default btn-sm">Edit</button>
</td>
</tr>
</table>
</td></tr>
<? }
} ?>
</table>
After that, I need to create a controller..Something like the administrator can modify the ie. "permission" field and when he save it, it remains for sure saved :P .
How do I create the controller for that?
Could anyone help me?
Thank you in advance.
EDIT:
This is the controller:
class Admin_Controller_Cms extends IV_View_Base {
public function routesAction() {
$this->assign( 'aRoutes', Default_Model_RouteEntity::getAllRoutes() );
$this->renderTemplate( 'cms/routes.phtml' );
}