Cases:
phpnamespace common\models;use yii\behaviors\TimestampBehavior;class User extends \yii\db\ActiveRecord implements IdentityInterface{public function behaviors() { return [ TimestampBehavior::className(), ]; }}
And
phpnamespace common\models;class User extends \yii\db\ActiveRecord implements IdentityInterface{public function behaviors() { return [ \yii\behaviors\TimestampBehavior::className(), ]; }}
What difference does it have? For example, the following will be used in the time to ... And the above one whether or not used are ... (Purely 自己YY )
P.S: If you step on my question, please give reasons, thanks (rest assured, I am not a squirt)
Reply content:
Cases:
phpnamespace common\models;use yii\behaviors\TimestampBehavior;class User extends \yii\db\ActiveRecord implements IdentityInterface{public function behaviors() { return [ TimestampBehavior::className(), ]; }}
And
phpnamespace common\models;class User extends \yii\db\ActiveRecord implements IdentityInterface{public function behaviors() { return [ \yii\behaviors\TimestampBehavior::className(), ]; }}
What difference does it have? For example, the following will be used in the time to ... And the above one whether or not used are ... (Purely 自己YY )
P.S: If you step on my question, please give reasons, thanks (rest assured, I am not a squirt)
Use only declares the location of the file that will be used later, and does not have a reference, but only when the call is loaded.
It is recommended to use the first method, and the file will be readable in the beginning.
Agree @ Sandy's big point of view, using the use of only just release the variables within the namespace, easy to write only, you can refer to my answer to read more: http://segmentfault.com/q/1010000002544855/a-1020000002544893