Advertisement
Guest User

Untitled

a guest
Mar 18th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <?php
  2.  
  3. namespace controllers;
  4.  
  5. use application\BaseController,
  6. models\RegisterModel;
  7.  
  8. class Register extends BaseController {
  9.  
  10. private $_model;
  11.  
  12. public function __construct() {
  13.  
  14. parent::__construct();
  15.  
  16. $this -> _model = new RegisterModel();
  17. }
  18.  
  19.  
  20.  
  21.  
  22.  
  23. public function run() {
  24.  
  25. $firstName = $this -> _normalize -> post('first_name', 'trim');
  26.  
  27. $lastName = $this -> _normalize -> post('last_name', 'trim');
  28.  
  29. $email = $this -> _normalize -> post('email', 'trim');
  30.  
  31. $username = $this -> _normalize -> post('username', 'trim');
  32.  
  33. $pass = $this -> _normalize -> post('pass', 'trim');
  34.  
  35. $passAgain = $this -> _normalize -> post('pass_again', 'trim');
  36.  
  37. $check = $this -> _normalize -> post('check');
  38.  
  39. try {
  40.  
  41. $this -> _model -> run($firstName, $lastName, $email, $username, $pass, $passAgain, $check);
  42. } catch (\Exception $ex) {
  43.  
  44. $this -> _view -> _messages = $ex -> getMessage();
  45.  
  46. $this -> registerLayout();
  47.  
  48. }
  49. }
  50.  
  51.  
  52.  
  53.  
  54.  
  55. private function registerLayout() {
  56.  
  57. $this -> _model -> html();
  58.  
  59. $this -> _view -> _title = $this -> _model -> _modelTitle;
  60. $this -> _view -> _description = $this -> _model -> _modelDescription;
  61. $this -> _view -> _keywords = $this -> _model -> _modelKeywords;
  62. $this -> _view -> _css = $this -> _model -> _modelCss;
  63. $this -> _view -> _javascript_1 = $this -> _model -> _modelJavascript_1;
  64. $this -> _view -> _javascript_2 = $this -> _model -> _modelJavascript_2;
  65. $this -> _view -> _link = $this -> _model -> _modelLink;
  66.  
  67. $this -> _view -> display('a_header');
  68. $this -> _view -> display('body_register');
  69. $this -> _view -> display('footer');
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement