// Oops no partial returned so can't hold for later processing
$data['test'] = Request::factory('test/index')->execute();
<?php
/**
* An example Controller. This shows the most basic usage of a Controller.
*/
class Controller_Welcome extends Controller {
public function action_index()
{
$data['test'] = Request::factory('test/index')->execute();
//echo '<pre>';
//print_r($data['test']);
//echo '</pre>';
$this->render('welcome/index', $data);
}
public function action_404()
{
// Set a HTTP 404 output header
Output::$status = 404;
$this->render('welcome/404');
}
}
<?php
namespace Test;
// Extending the calling controller also works if we wish to implement something specific.
//class Controller_Test extends \Controller_Welcome {
class Controller_Test extends \Controller {
public function action_index()
{
// Echo the required output to be captured as a partial
echo Model_Test::hello_world();
}
}
<?php
namespace Test;
class Model_Test extends \Model {
public static function hello_world()
{
return 'hello world!<br />';
}
}
Fuel\Core\Request Object
(
[paths] => Array
(
[0] => C:\xampp\htdocs\Customer_Sites\fuel\fuel\app\modules\test\
[1] => C:\xampp\htdocs\Customer_Sites\fuel\fuel\app\modules\test\classes\
)
[output] =>
[uri] => Fuel\Core\Uri Object
(
[uri] => test/index
[segments] => Array
(
[0] => test
[1] => index
)
)
[module] => test
[directory] =>
[controller] => test
[action] => index
[method_params] => Array
(
[0] =>
)
[named_params] => Array
(
)
)
Finished the project I was working on so I will look at Fuel some more now.
Thanks for your help Jelmer it's much appreciated.It looks like you're new here. If you want to get involved, click one of these buttons!