Created
April 10, 2012 13:39
-
-
Save meotimdihia/2351444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#Put `AppUsersController.php` in `app/Controller` | |
App::uses('UsersController', 'Users.Controller'); | |
class AppUsersController extends UsersController { | |
public function beforeFilter() | |
{ | |
parent::beforeFilter(); | |
$this->User = ClassRegistry::init('AppUser'); #require AppUser.php in Model | |
} | |
protected function _getMailInstance($config = 'default') | |
{ | |
App::uses('CakeEmail', 'Network/Email'); | |
return new CakeEmail($config); | |
} | |
public function render($file = null, $layout = null) | |
{ | |
if (!file_exists(APP . 'View' . DS . 'Users' . DS . $this->action . '.ctp')) { | |
$file = App::pluginPath('Users') . 'View' . DS . 'Users' . DS . $this->action . '.ctp'; | |
} else { | |
$file = APP . 'View' . DS . 'Users' . DS . $this->action . '.ctp'; | |
} | |
return parent::render($file, $layout); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment