Yii Framework Forum: Yii2 With Namespaces And Yii2 Without Namespaces - Yii Framework Forum

Jump to content

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

Yii2 With Namespaces And Yii2 Without Namespaces

#1 User is offline   egorpromo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 02-December 12

Posted 20 July 2013 - 05:55 AM

Is it possible to create two Yii2? First Yii2 will be with namespaces. But if developers don't need namespaces in their project there is second Yii2 without namespaces.
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 538
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 20 July 2013 - 05:57 AM

Why? Whats wrong with just using them?

Also there are many things that rely on namespaces to work properly, this is not possible and also not wanted.
0

#3 User is offline   egorpromo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 66
  • Joined: 02-December 12

Posted 20 July 2013 - 06:05 AM

View PostCeBe, on 20 July 2013 - 05:57 AM, said:

Why? Whats wrong with just using them?

1) It is difficult to understand in some circumstances
2) It is more slowly performance
3) There is no namespaces in older versions of PHP
I am not using namespaces on my small projects because it is difficult. It is my own opinion only.
0

#4 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 538
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 20 July 2013 - 06:55 AM

View Postegorpromo, on 20 July 2013 - 06:05 AM, said:

1) It is difficult to understand in some circumstances


There is nothing difficult about it. It is similar to aliases in Yii1.1
It is a core concept of PHP now and as PHP developer you should learn how it works.

View Postegorpromo, on 20 July 2013 - 06:05 AM, said:

2) It is more slowly performance


What makes you think that? As it is used for autoloading, one could argue that by not using php include path anymore it gets faster rather than slower.

View Postegorpromo, on 20 July 2013 - 06:05 AM, said:

3) There is no namespaces in older versions of PHP


This is why minimum requirement is PHP 5.3 which also has reached end of life already and only gets security fixes.
You really should upgrade to a higher version if you are still using PHP < 5.3. Don't fear learning new things! ;)
0

#5 User is offline   Fredi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-January 12

Posted 20 July 2013 - 10:20 AM

egorpromo I recommend you to use nice IDE with namespace support like Netbeans or PHPStorm. It will help you with importing stuff.
0

#6 User is offline   sensorario 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,987
  • Joined: 07-September 10
  • Location:Cesena (Italy)

Posted 21 July 2013 - 02:02 AM

Difficult tu understand dont means unnecessary. If you need help tu understand namespaces, just make your questions here. Namespaces are very very important.
0

#7 User is offline   Jaggi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 90
  • Joined: 05-September 11

Posted 22 July 2013 - 08:08 AM

You also do not need to understand namespaces to use the framework. It just works. If you're doing heavy development you will need to but then by this point you should have learnt namespaces.
See my development site @ www.CodeTheInter.net (BETA)

Posted Image Posted Image

Quote

If you make it idiot proof, they'll build a better idiot
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