Ejemplo n.º 1
0
 /**
  * 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';
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }