Advertisement
Guest User

slim function problem 2

a guest
Aug 2nd, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. //external file with function
  2. function  getThemer($key,$id) {
  3.    $themer = R::find("themers","id = ?",[$id]);
  4.    echo json_encode(R::exportAll($themer));
  5.    return true;
  6. }
  7.  
  8. function countThemer(){
  9.     echo "count";
  10.     $count =  R::exec( 'SELECT COUNT(id) FROM themers' );
  11.     echo $count;
  12. }
  13.  
  14. function allowed($key){
  15.     $app = \Slim\Slim::getInstance();
  16.     $params = $app->router()->getCurrentRoute()->getParams();
  17.     if(!($params["key"]=="giulio"))
  18.         $app->redirect ("http://google.com");
  19.    
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement