/** * Parse, render and return the presentation. * * @return string A string representing the rendered presentation. */ function _render() { # put attributes into scope extract($this->_attributes); # get generator object $update_page = new Flexi_JavascriptGenerator(); # include template, parse it and remove output ob_start(); require $this->_template; ob_end_clean(); return $update_page->to_s(); }
function test_jsgen() { $page = new Flexi_JavascriptGenerator(); $page->insert_html('bottom', 'list', '<li>Last item</li>'); $page->replace_html('person-45', 'Deleted.'); $page->replace('person-45', 'Deleted.'); $page->remove('id-1', 'id-2', 'id-3'); $page->show('id-1', 'id-2', 'id-3'); $page->hide('id-1', 'id-2', 'id-3'); $page->toggle('id-1', 'id-2', 'id-3'); $page->alert('Some "Message"!\\/'); $page->redirect_to('http://www.google.com'); $page->delay('alert("Hallo Welt")', 23); $page->visual_effect('highlight', 'id-42'); # TODO (mlunzena) no asserts # var_dump($page->to_s()); }