Yii Framework Forum: I'm Getting Weird Error (Unexpected T_Paamayim_Nekudotayim) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

I'm Getting Weird Error (Unexpected T_Paamayim_Nekudotayim) Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expectin Rate Topic: -----

#1 User is offline   erikcute 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-February 13

Posted 13 February 2013 - 09:21 AM

First time I encountered this kind of error. My code is as below:

if ($model->blog_status == MyBlog::$STATUS_NEW ||
    $model->blog_status == MyBlog::$STATUS_DRAFT) {
    if ($model->blog_status == MyBlog::$STATUS_NEW) {
	echo CHtml::submitButton('', array(
	'name'=>$this::$SAVE_AS_DRAFT, 'title'=>'Save as Draft', 'class'=>'button-draft',
	'onclick'=>'return confirm(\'Are you sure you want to Save as Draft?\')',
	));
    }
    echo CHtml::submitButton('', array(
	'name'=>$this::$SUBMIT, 'title'=>'Submit', 'class'=>'button-save',
	'onclick'=>'return beforeSubmit(\'Are you sure you want to Submit?\');',
	));
}


This code works on my local machine however when I try to run my code in my production server...I keep on getting the error "Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ')..."

Please help...Thanks!
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,614
  • Joined: 17-January 09
  • Location:Russia

Posted 13 February 2013 - 12:11 PM

PAAMAYIM_NEKUDOTAYIM is ::

$this::$SAVE_AS_DRAFT looks wrong.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,222
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 13 February 2013 - 12:13 PM

View Postsamdark, on 13 February 2013 - 12:11 PM, said:

$this::$SAVE_AS_DRAFT looks wrong.

True. It should either be self::$SAVE_AS_DRAFT (static call) or $this->$SAVE_AS_DRAFT.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

#4 User is offline   Ahamed Rifaideen 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 381
  • Joined: 14-February 13
  • Location:chennai, tamilnadu

Posted 14 February 2013 - 10:30 AM

T_Paamayim_Nekudotayim is an arrow operator(->) this is the error i think check it out your code:-)
My Blog - Yii Learner
0

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,614
  • Joined: 17-January 09
  • Location:Russia

Posted 14 February 2013 - 05:00 PM

It's not arrow, it's ::
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#6 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 15 February 2013 - 11:37 AM

It's not C++, it's PHP. Posted Image
"Less noise - more signal"
0

#7 User is offline   Ahamed Rifaideen 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 381
  • Joined: 14-February 13
  • Location:chennai, tamilnadu

Posted 15 February 2013 - 01:34 PM

View Postsamdark, on 14 February 2013 - 05:00 PM, said:

It's not arrow, it's ::

oh thanks buddy
My Blog - Yii Learner
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users