phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
FormAccount.php
Go to the documentation of this file.
1<?php
8class FormAccount extends BusinessForm {
13 public function __construct($identifier,$modelInstance=null,$fieldsOrder=[],$fieldsDefinition=[],$fields=[],$captions=[],$separators=[]) {
14 parent::__construct($identifier,$modelInstance,$fieldsOrder,$fieldsDefinition,$fields,$captions,$separators);
15 }
16
17 protected function getDefaultModelInstance(){
18 return new UserModel();
19 }
20
21 public static function regular($identifier,$modelInstance=null){
22 return new FormAccount($identifier,$modelInstance,
23 ["message","login","password","passwordConf","email","submit","error"],
24 ["message"=>[["icon"=>"sign in"]],
25 "input0"=>[["rules"=>"empty"]],
26 "input1"=>[["inputType"=>"password","rules"=> ['minLength[6]', 'empty']]],
27 "input2"=>[["inputType"=>"password","rules"=> ['minLength[6]', 'empty', 'match[password]']]],
28 "input3"=>[["rules"=>"email"]],
29 "submit"=>["green fluid"],
30 "message2"=>[["error"=>true]]],
31 ["Account","login","password","passwordConf","email","submit","error"],
32 ["Please enter your account informations","Login","Password","Password confirmation","Email address","Creation"],
33 [0,1,3,4,5,6]);
34 }
35
36 public static function smallInline($identifier,$modelInstance=null){
37 $result=new FormAccount($identifier,$modelInstance,
38 ["login","password","submit"],
39 ["input0"=>[["rules"=>"empty"]],"input1"=>[["inputType"=>"password","rules"=>"empty"]],"submit"=>["green basic"]],
40 ["login","password","submit"],
41 ["","","Connection"],
42 [2]);
43 $result->addDividerBefore(0, "Connection");
44 return $result;
45 }
46
47 public static function small($identifier,$modelInstance=null){
48 $result=new FormAccount($identifier,$modelInstance,
49 ["login","password","passwordConf","email","submit"],
50 [
51 "input0"=>[["rules"=>"empty"]],
52 "input1"=>[["inputType"=>"password","rules"=>['minLength[6]', 'empty']]],
53 "input2"=>[["inputType"=>"password","rules"=> ['minLength[6]', 'empty', 'match[password]']]],
54 "input3"=>[["rules"=>"email"]],
55 "submit"=>["green basic"]],
56 ["login","password","passwordConf","email","submit"],
57 ["Login","Password","Password confirmation","Email address","Creation"],
58 [1,2]);
59 $result->addDividerBefore(0, "Creation");
60 return $result;
61 }
62
63 public static function attachedSegment($identifier,$modelInstance=null){
64 $result=self::regular($identifier,$modelInstance);
65 $result->fieldAsMessage("message",["icon"=>"sign in","attached"=>true]);
66 $result->addWrapper("message",null,"<div class='ui attached segment'>");
67 $result->addWrapper("error", null,"</div>");
68 return $result;
69 }
70}
__construct($identifier, $modelInstance=null, $fieldsOrder=[], $fieldsDefinition=[], $fields=[], $captions=[], $separators=[])
static smallInline($identifier, $modelInstance=null)
static small($identifier, $modelInstance=null)
static attachedSegment($identifier, $modelInstance=null)
static regular($identifier, $modelInstance=null)