Created
March 31, 2011 11:07
Revisions
-
nautilebleu created this gist
Mar 31, 2011 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ <?php // in application/app/php/lib/app_manager/app_manager.class.php class AppManager extends WebApplication // ... /** * render the component */ public function render($template, $params) { $this->display_header($trail); $path = sprintf('%s/../templates/%s.php', dirname(__FILE__), $template); foreach ($params as $name => $value) { $$name = $value; } include($path); $this->display_footer(); } ?> <?php // in application/app/php/lib/app_manager/component/browser.class.php class AppManagerBrowserComponent extends AppManager { function run() { $form = new AppForm($this->get_view_url()); $form->build(); if (Request::post('test') !== null) { if ($form->validate()) { $form->save(); $this->redirect('Message', false); } } $this->render('browse', array('form' => $form)) ; } } ?> // in application/app/php/lib/templates/browse.html.php <h2>Hello world</h2> <a href="<?php echo $this->get_browse_url(); ?>">Link</a> <?php echo $form->toHtml(); ?>