-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.

CRABOLO
  • 8,605
  • 39
  • 41
  • 68
Yoga
  • 27
  • 1
  • 4
  • To access any function of a class we use ::(Scope Resolution) To access in such a way a function must be static – Jenno Richi Benat Dec 16 '13 at 09: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. – The Humble Rat Dec 16 '13 at 10:11

1 Answers1

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.

Chaulagai
  • 752
  • 8
  • 12