basePathMustBeAString() public static method

public static basePathMustBeAString ( )
示例#1
0
 /**
  * Add a base path to be used when matching routes. Eg /v1 would be useful IF you want versioning in the URL
  * @param  string         $basePath
  * @throws DrestException
  */
 public function addRouteBasePath($basePath)
 {
     if (!is_string($basePath)) {
         throw DrestException::basePathMustBeAString();
     }
     $this->_attributes['routeBasePaths'][] = trim($basePath, '/');
 }