tag:blogger.com,1999:blog-5023448542823447711.post8432174240198177254..comments2023-09-22T04:05:16.253-07:00Comments on Optimizely Module: Notes on Converting to Drupal 8: Initial cut at routing system with PSR-4 autoloadingEarl Fonghttp://www.blogger.com/profile/05682372868411855409noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5023448542823447711.post-34622525818565947892014-05-23T18:48:00.597-07:002014-05-23T18:48:00.597-07:00I want to emphasize that the #type key is optional...I want to emphasize that the #type key is optional if #markup is used. However, it looks required together with certain other keys. I will keep in mind the need to clarify this in future posts.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-36201571612296505202014-05-21T08:28:18.711-07:002014-05-21T08:28:18.711-07:00I only mentioned the #type key because it shows up...I only mentioned the #type key because it shows up in example code in tutorials, but it's no longer needed. Apparently, in the past #type was needed together with #markup .<br /><br />My own demo code only has #markup and works fine.Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-7358025530976618882014-05-21T08:06:58.023-07:002014-05-21T08:06:58.023-07:00As I understand it, PSR-4 requires a simpler and s...As I understand it, PSR-4 requires a simpler and shallower directory structure. That was enough of an advantage that it was worth the pain of switching from one standard to the other.<br /><br />The use of namespaces in the code is not affected by this change.<br /><br />I'm in favor of the change. The deeper the filesystem structure, the harder it is to navigate it, even when you have supportive tools.<br /><br />It was confusing for me as a beginner to have various write-ups and tutorials, written at different points in time, that used one or the other or both and having to sort through it all. I had to glean what is current and accurate from what is now beoming obsolete.<br /><br />"Drupal and PSR-0/PSR-4 Class Loading"<br />https://drupal.org/node/1971198Earl Fonghttps://www.blogger.com/profile/05682372868411855409noreply@blogger.comtag:blogger.com,1999:blog-5023448542823447711.post-58928309699882176142014-05-21T06:55:15.971-07:002014-05-21T06:55:15.971-07:00What are your feelings about the differences betwe...What are your feelings about the differences between PSR-0 vs PSR-4? You mentioned the directory structure difference, is there anything else? What's the point of choosing one over the other and why did the project change half way through? I'm so thankful that autoloading will be supported. It felt like the stone ages without it.<br /><br />Can you explain more about the `#type` key? Is it still used or optional? Perhaps post an example or a source that supports your statement?<br />Anonymousnoreply@blogger.com