Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

if in class Milesto...
 
Notifications
Clear all

if in class Milestone

7 Posts
2 Users
0 Reactions
8,334 Views
(@a-mikael)
Posts: 35
Active Member
Topic starter
 
[#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


 
Posted : 06 Dec 2012 13H57
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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


 
Posted : 06 Dec 2012 16H27
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

Where i can replace this code to change $_fieldsAttributes ?

because if :

$this->idMilestoneType == 23

in $_fieldsAttributes=array(

"refCustomer"=>"required"

else

"refCustomer"=>"hidden"

 
Posted : 06 Dec 2012 16H42
babynus
(@babynus)
Posts: 14966
Main Contributor Admin
 

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


 
Posted : 06 Dec 2012 18H51
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

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


 
Posted : 07 Dec 2012 12H36
babynus
(@babynus)
Posts: 14966
Main Contributor 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" 👿


 
Posted : 07 Dec 2012 13H25
(@a-mikael)
Posts: 35
Active Member
Topic starter
 

If field is not required, just remove "required"

Is true :S


 
Posted : 07 Dec 2012 13H29
Share:

Scroll to Top