namespace Nox; class Controller_Nox extends \Controller{ //put your code here public function action_index(){ $this->output = Model_Core::hello(); //this isn't work //echo Model_Core::hello(); //this is work } }
namespace nox; class Model_Core { //put your code here public static function hello(){ return "Hello World"; } }
namespace Nox; class Controller_Nox extends \Controller { public function action_index() { return Model_Core::hello(); } }
php oil generate controller coba
<?php class Controller_Coba extends Controller_Template { public function action_index() { $this->template->title = 'Coba » Index'; $this->template->content = View::forge('coba/index'); //return $this->template; //I add this and believe it will work, but not } } ?>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><?php echo $title; ?></title> <?php //echo Asset::css('main.css'); ?> </head> <body> <div id="wrapper"> <h1><?php echo $title; ?></h1> <div id="content"> <?php echo $content; ?> </div> </div> </body> </html>to the template, everything work as expected. I think the documentation about controller should also be updated to avoid confussion
It looks like you're new here. If you want to get involved, click one of these buttons!