Restler
Restler copied to clipboard
Switching from Resources to Explorer class.
I'm trying to migrate up to the v3 branch on git from rc5 and can't seem to get the switch from Resources to Explorer right. Do I still need to reference the Resources class? The Explorer class never executes anything to do with $excludedPaths.
// Libraries.
use Luracast\Restler\Restler;
use Luracast\Restler\Defaults;
use Luracast\Restler\Explorer;
Explorer::$excludedPaths = array('authorize', 'login', 'grant', 'setPaginationLinkPreviousPage', 'setPaginationLinks', 'server');
Explorer::$hideProtected = false;
$r->addAPIClass('Dafwa\\SoilWater\\SoilWater');
$r->addAPIClass('Explorer');
excluded paths should be urls relative to the api root. Looking at your example I guess authorize login etc are the methods in SoilWater class
So the exclude paths should be
Explorer::$excludePaths = array('soilwater/authorize', 'soilwater/login'); // do add the rest of the urls in a similar way