PSR 4

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
christoforosKor
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Mon Aug 27, 2012 2:22 pm

PSR 4

Postby christoforosKor » Thu Dec 21, 2017 8:10 am

Hello,
I 'd like to develop a component using psr4 coding standard. Is there an example for the best way to do this with joomla 3.8 ?
Last edited by toivo on Thu Dec 21, 2017 8:54 am, edited 1 time in total.
Reason: mod note: moved from Extensions.Joomla.org Feedback forum

RedEye
Joomla! Ace
Joomla! Ace
Posts: 1460
Joined: Sat Jan 21, 2006 8:42 pm

Re: PSR 4

Postby RedEye » Thu Dec 28, 2017 3:09 am

psr4 is only autoloading, what best way you need to know here?

christoforosKor
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Mon Aug 27, 2012 2:22 pm

Re: PSR 4

Postby christoforosKor » Fri Dec 29, 2017 7:50 am

RedEye wrote:psr4 is only autoloading, what best way you need to know here?


PSR 4 has a specific way for naming paths, files and classnames which does not comfort joomla naming rules for classes.

For example file mymodel.php contains the class MyComponentModelMyModel. This class can not be loaded from PSR4. To be loaded from PSR4 this class shoulb be named Mymodel.
If you make the above example with views it is even worse.

So this is why I am asking fo the best way to use PSR4 with joomla. Is there a discussion for changing naming rules on joomla or is there somewhere a guide I should look?


Return to “Joomla! 3.x Coding”

Who is online

Users browsing this forum: No registered users and 3 guests