コード例 #1
0
ファイル: Files.php プロジェクト: noordawod/micro-router
 /**
  * Returns the name of corresponding PHP script for the specified query.
  *
  * @param \Fine47\MicroRouter\Interfaces\Query $query to return its script
  * @return string name of corresponding PHP script
  */
 protected function getFilterScriptName(Interfaces\Query $query)
 {
     return strtolower($query->getMethod()) . '.filters.php';
 }
コード例 #2
0
 /**
  * Decodes the query's body and return it as JSON object.
  *
  * @param \Fine47\MicroRouter\Interfaces\Query $query to decode
  * @return array|FALSE decoded JSON data, FALSE on error
  */
 protected function getQueryData(Interfaces\Query $query)
 {
     return Util\Json::decode($query->getRawBody());
 }
コード例 #3
0
ファイル: Mandatory.php プロジェクト: noordawod/micro-router
 /**
  * Returns the submitted parameters of the specified query.
  *
  * @param \Fine47\MicroRouter\Interfaces\Query $query to decode
  * @return array|FALSE submitted parameters, FALSE on error
  */
 protected function getQueryData(Interfaces\Query $query)
 {
     if ($query instanceof Requests\HttpJson) {
         return $query->getBody();
     }
     return false;
 }