Search code examples
whitelistfuelphp

Adding custom model to whitelist in fuelphp


I simply want to add one of my custom made Model classes to the fuelphp whitelist, but i cant find what path I should specify to make it work.

This is what it looks like (within config.php):

'whitelisted_classes' => array( 'Fuel\Core\Response', 'Fuel\Core\View', 'Fuel\Core\ViewModel', 'Closure' )

i want to add Model_Piece onto that list Model_Piece is located in fuel/app/classes/model

'Fuel\app\classes\model\Model_piece' does not work

What am I missing here? I am not too familiar with fuelphp yet so any help is welcome.


Solution

  • It's actually a namespace which you're entering into the whitelisted_classes array (although technically this is supposed to relate to the path to the file).

    If you have not namespaced your model specifically it'll be in the root namespace and therefore you should just be able to put the following into the whitelisted_classes array.

    Model_piece (or possibly \Model_piece)