Forum

if in class Milesto...
 
Notifications
Retirer tout

if in class Milestone

7 Posts
2 Utilisateurs
0 Reactions
8,315 Vu
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 
[#849]

Hi,

i need to use a condition in my class Milestone :

  private $statusField;
  
  if ($idMilestoneType == 23){
	$statusField = "required";
  } else $statusField = "hidden";

And i have an error in projectorria :

Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in C:wampwwwbeta_V3.1modelMilestone.php on line 57

thx


 
Posté : 6 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

1) code does not seem to be in the right place.
2) $idMilestoneType is not known : use $this->idMilestoneType


 
Posté : 6 Déc PM 16:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

Where i can replace this code to change $_fieldsAttributes ?

because if :

$this->idMilestoneType == 23

in $_fieldsAttributes=array(

"refCustomer"=>"required"

else

"refCustomer"=>"hidden"

 
Posté : 6 Déc PM 16:1212
(@babynus)
Posts: 14952
Membre Admin
 

in __construct, after parent::__construct($id);


 
Posté : 6 Déc PM 18:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

Okay, i can change now attribute of my field in __construct ;D

But now, i use attribute "nobr" because my textfield isn't required. But nobr hide the label associated :

Thx


 
Posté : 7 Déc PM 12:1212
(@babynus)
Posts: 14952
Membre Admin
 

But now, i use attribute "nobr" because my textfield isn't required. But nobr hide the label associated

It is exactly what "nobr" stands for :whistle:
If field is not required, just remove "required" 👿


 
Posté : 7 Déc PM 13:1212
(@a-mikael)
Posts: 35
Active Member
Début du sujet
 

If field is not required, just remove "required"

Is true :S


 
Posté : 7 Déc PM 13:1212
Share:
Retour en haut