Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## templates/DataGrid.php
- <table>
- <?php if(count($template['headings']) > 0){ ?>
- <tr><?php foreach($template['headings'] as $heading){ ?>
- <th><?php echo $heading; ?></th><?php } ?>
- </tr>
- <?php } foreach($template['rows'] as $rows){ ?>
- <tr><?php foreach($rows as $column){ ?>
- <td><?php echo $column; ?></td>
- </tr>
- <?php } ?>
- </table>
- ## AdminBaseView.class.php
- protected function dataGrid($data, $headings = array())
- {
- $this -> setAttribute("data", $data);
- $this -> setAttribute("headings", $headings);
- $dataGridRendered = ...
- $this -> setAttribute("datagrid", $dataGridRendered);
- }
- ## modules/Products/views/ManageSuccessView.class.php
- <?php
- class Products_ManageSuccessView extends AdminBaseView
- {
- public function executeHtml(AgaviRequestDataHolder $rd)
- {
- parent::setupHtml($rd);
- $products = $model -> getAll();
- $this -> dataGrid($products);
- }
- }
- ?>
- ## modules/Products/templates/ManageSuccess.php
- <h2>Products</h2>
- ...
- <div id="datagrid">
- <?php echo $template['datagrid']; ?>
- </div>
Add Comment
Please, Sign In to add comment