-3

I'm a newbie in programming and now I'm learning yii framework and it's really hard.

What does this declaration mean : something::something

for instance : CHtml::encode, yii::appname, CHtml::dropDownList, etc...

 Yii::app()->request->baseUrl; CHtml::encode($data->getAttributeLabel 

What does it actually means?

And do you guys have a recommendation for learning yii framework other than Larry Ullman's? I really need a tutorial.

Thanks.

2
  • To access any function of a class we use ::(Scope Resolution) To access in such a way a function must be static Commented Dec 16, 2013 at 9:27
  • It refrences a class. So if you have the db table accounts, then you will likely have a model called Accounts. Within the model you can create methods (functions) for example shorten the name. So to access this method you would do say echo Accounts::shortenName($model->name); . So the value would be passed to the shorten name method of the Acounts model and return the result. This is fundamental to how yii works. Commented Dec 16, 2013 at 10:11

1 Answer 1

1

That is the part of language(PHP), also called scope resolution (::). Not only with YII, its common to all PHP framework. Please go with some PHP language manual first, its tutorials. Then only you will be comfortable with any PHP framework like YII.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.