public function _show() { $oCategories = model_categories::getInstance()->findById(module_categories::getParam('id')); $oView = new _view('categories::show'); $oView->oCategories = $oCategories; return $oView; }
public function before() { $this->oLayout = new _layout('template1'); //instancier le module $oModuleCategories = new module_categories(); //recupere la vue du module $oView = $oModuleCategories->_index(); //assigner la vue retournee a votre layout $this->oLayout->add('sidebar', $oView); //posts (main) $oModuleExamplemodule = new module_posts(); //recupere la vue du module $oViewModule = $oModuleExamplemodule->_lastList(); //assigner la vue retournee a votre layout $this->oLayout->add('sidebar', $oViewModule); }
<tr> <th>name</th> <td><?php echo $this->oCategories->name; ?> </td> </tr> <tr> <th>slug</th> <td><?php echo $this->oCategories->slug; ?> </td> </tr> <tr> <th>post_count</th> <td><?php echo $this->oCategories->post_count; ?> </td> </tr> </table> <p><a href="<?php echo module_categories::getLink('list'); ?> ">Retour</a></p>