I have two classes: MyAccountPage
and PersonalData_Validator1
class MyAccountPage extends Page {
public function canCreate($member = null) {
return false;
}
}
class MyAccountPage_Controller extends Page_Controller {
private static $allowed_actions = array(
'editprofile'
);
public function EditProfileForm(){
$firstName = new TextField('FirstName', 'First Name *');
$firstName->addExtraClass('requiredField form-control');
$surName = new TextField('Surname', 'Last Name *');
$surName->addExtraClass('requiredField form-control');
...
$validator = new PersonalData_Validator1(array(
$firstName,
$surName
));
}
When I write PersonalData_Validator1
class in the same page it works, but when I write PersonalData_Validator1
in another page it doesn't work. Why doesn't this work?
this is my PersonalData_Validator1 class