alombarte/SIFO — pull request #21 by nilopc (2013-04-26 22:08:06+00:00)
Title: Added check before executing a class method other than build.

Line 638: method_exists($this,$this->params['controller_method'])) is necessary in order to avoid loading inexistant methods from the current class instance, and moreover, any class instances invoked when loading them as a module (using $this->addModule()).

Eg: Using the new router, we want to run update method.
```php
class HomeIndexController extends \Sifo\Controller
{
function update($id)
{
//...
$this->addModule('flash_message','HomeFlashMessage');
//...
}
}
```
and the module...
```php
class HomeFlashMessage extends \Sifo\Controller
{
function build()
{
//...
}
}
```
$this->addModule will invoke HomeFlashMessage. If the current \Sifo\Controller class is not patched, the current code will try to run the "update" method on HomeFlashMessage, resulting in an error. This patch defaults to build() as the update() method doesn't exist.