Datagrid Simple

De KumbiaPHP Framework Wiki

falta corregir


Modo de uso

	  View::partial('datagrid/simple', 
	  				false,
		 			 array(	'Modelo' => Load::model('dirigente')->find() ,
							'Campos' => array(	'Codigo' => 'id',
										'Nombre' => 'nombre',
										'Telefono' => 'telefono',
										'Direccion' => 'direccion'))
					)
	echo "<div id=\"datagrid\">";
		echo "<table  border=\"1px\" class=\"simple\">";
		echo "<thead><tr>";
			foreach( $Campos  as $titulo => $valor):
				echo "<th>" . $titulo . "</th>";
			endforeach;
		echo "</tr></thead><tbody>";
			foreach( $Modelo as $model):
				echo tr_color_class( 'tr_primary', 'tr_secondary' );
				foreach($Campos as  $campos):
					echo "<td>". $model->$campos . "</td>";
				endforeach;
				echo "</tr>";
			endforeach;
		echo "</tbody></table></div>";