Advertisement
Guest User

ArrayModified

a guest
Feb 28th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. //index.php
  2. ...
  3. if($_POST){
  4.       $vars['post'] = $_POST;
  5.       var_dump($vars);
  6.  }
  7.  
  8. call_user_func_array(array($controller, $action), $vars);  
  9.  
  10. //someController.php
  11.     ....
  12.     $vars = array();
  13.  
  14.         if (isset($params['post'])) {
  15.             $this->model = new Contact();
  16.             $em = EMF::build();
  17.  
  18.             var_dump($params['post']);
  19.              
  20.             $variables = $params['post'];
  21.  
  22.             $this->model->setName($variables['name']);
  23.             $this->model->setEmail($variables['email']);
  24.             $this->model->setTelephone($variables['phone']);
  25.             $this->model->setMessage($variables['message']);
  26.  
  27.             $em->persist($this->model);
  28.             $em->flush();
  29.              
  30.             $vars['message'] = "Your query has been successfully submitted!";
  31.         }
  32.         var_dump($vars);
  33.         var_dump($params);
  34.     .....
  35. //output
  36. array(1) { ["post"]=> array(4) { ["name"]=> string(13) "DwBoothe" ["email"]=> string(16) "testing@test.com" ["phone"]=> string(11) "18766765449" ["message"]=> string(1) "t" } } array(0) { } array(4) { ["name"]=> string(13) "DwBoothe" ["email"]=> string(16) "testing@test.com" ["phone"]=> string(11) "18766765449" ["message"]=> string(1) "t" }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement