Hello,
I'm quite new to Silverstripe and currently trying to make a module where 2 different kinds of users can register themselves or edit their profile.
To achieve this, I would like to use the multiform module. I installed it and it works using the kind of procedure described in the tutorials and the silverstripe book (using a specific page for the registration, which can be placed in the menu).
However, I tried to make a user registration proces similar to the one in the forum module, using a "register" action in a "BusinessUser" page controller, without a specific page. It then shows step 1 of the form correctly, but doesn't proceed to step 2.
Can anyone please explain a bit what's going wrong here (so that I learn a bit more about the idea behind the system) and probably give a suggestion how to deal with it?
class BusinessRegistrationMultiForm extends MultiForm {
public static $start_step = 'BusinessRegistrationFirstStep';
// ...
}
class BusinessRegistrationFirstStep extends MultiFormStep {
public static $next_steps = 'BusinessRegistrationLastStep';
function getFields() {
$fields = singleton( 'Member' )->getBusinessFirstFields();
return $fields;
}
}
class MemberProfile extends Page_Controller {
function register() {
return array(
"Title" => 'titel',
"Subtitle" => 'Register',
);
}
function Link($action = null) {
return "$this->class/$action";
}
}
class BusinessProfile extends MemberProfile {
function BusinessRegistrationForm() {
return new BusinessRegistrationMultiForm($this, 'BusinessRegistrationForm');
}
}
And then in BusinessProfile_register.ss
$Content
<p>Hi</p>
<div id="UserProfile">
<% if CurrentMember %>
<p><% _t('PLEASELOGOUT', 'Please logout before you register') %> - <a href="Security/logout"><% _t('LOGOUT', 'Logout') %></a></p>
<% else %>
$BusinessRegistrationForm
<% end_if %>
</div>
Thanks, Jeroen.