Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Custom requirements for Login/Password recovery Form


Go to End


2615 Views

Avatar
Tonyair

Community Member, 81 Posts

3 October 2010 at 6:50am

Hello, I managed to add custom requirements to Login form, but how can i add them to password recovery form?

Object::useCustomClass('MemberLoginForm', 'CustomLoginForm');

class CustomLoginForm extends MemberLoginForm {

	function custom_requirements() {
		Requirements::combine_files("comb_member_login.css",array(
												'themes/'.SSViewer::current_theme().'/css/member_login.css',
												'mysite/javascript/niceforms/niceforms.css'
											));
		Requirements::combine_files('comb_forms.js',array('mysite/javascript/niceforms/niceforms.js'));
	}
	
	function __construct($controller, $name, $fields = null, $actions = null,
											 $checkCurrentUser = true) {
		self::custom_requirements();
		parent::__construct($controller, $name, $fields = null, $actions = null,$checkCurrentUser = true);
	}

}