Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace controllers;
- use application\BaseController,
- models\RegisterModel;
- class Register extends BaseController {
- private $_model;
- public function __construct() {
- parent::__construct();
- $this -> _model = new RegisterModel();
- }
- public function run() {
- $firstName = $this -> _normalize -> post('first_name', 'trim');
- $lastName = $this -> _normalize -> post('last_name', 'trim');
- $email = $this -> _normalize -> post('email', 'trim');
- $username = $this -> _normalize -> post('username', 'trim');
- $pass = $this -> _normalize -> post('pass', 'trim');
- $passAgain = $this -> _normalize -> post('pass_again', 'trim');
- $check = $this -> _normalize -> post('check');
- try {
- $this -> _model -> run($firstName, $lastName, $email, $username, $pass, $passAgain, $check);
- } catch (\Exception $ex) {
- $this -> _view -> _messages = $ex -> getMessage();
- $this -> registerLayout();
- }
- }
- private function registerLayout() {
- $this -> _model -> html();
- $this -> _view -> _title = $this -> _model -> _modelTitle;
- $this -> _view -> _description = $this -> _model -> _modelDescription;
- $this -> _view -> _keywords = $this -> _model -> _modelKeywords;
- $this -> _view -> _css = $this -> _model -> _modelCss;
- $this -> _view -> _javascript_1 = $this -> _model -> _modelJavascript_1;
- $this -> _view -> _javascript_2 = $this -> _model -> _modelJavascript_2;
- $this -> _view -> _link = $this -> _model -> _modelLink;
- $this -> _view -> display('a_header');
- $this -> _view -> display('body_register');
- $this -> _view -> display('footer');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement