I am trying to create a new Module in APPPATH.'modules'.DS
I update main config.php
'modules' => array('pages'),
and
'module_paths' => array(
APPPATH.'modules'.DS
),
I am trying to run my module: site.com/public/index.php/pages/index but its doesnt work
I see 404 page of welcome controller insted of Index action of Pages controller (in Pages Module!)
There is my pages module http://minus.com/ly5eWPVAG4JNz
What I do wrong ?
Also I am trying to create this simple module http://scrp.at/py
index.php/test/index
And result is
Error!
Fuel\Core\FuelException [ Error ]: Test\Controller_Test::action_index() or the controller after() method must return a Response object.
what is "$this->output" ?
A FuelPHP action method should return either a Reponse object, or something that can be cast to string (like a string, a View object, etc). In the last case FuelPHP will convert that in a Response object for you.
Can you provide me really simple working (MVC + routing) example of phpFuel Module ? Because I create "pages" module according to the docs and it doesn't work.
It works with namespace Test
<?php
namespace Test;
class Controller_Test extends \Controller {
public function action_index() {
return \Response::forge('text....');
}
}
I think I can rewrite this code in this way (Its works)
<?php namespace Test;
use \Controller;
use \Response;
class Controller_Test extends Controller {
public function action_index() {
return Response::forge('Test Module');
}
}
yes ?