nette / latte

☕ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
https://latte.nette.org
Other
1.09k stars 107 forks source link

feature request: inline comments in tag #341

Open peminator opened 1 year ago

peminator commented 1 year ago

There should be added ability to add single-line comments to array definitions, if multiline works too. Its usefull for defining arrays in latte to keep understandable code

{var $aa = [
      'a'=>'b' /* this comment type works ok */
    , 'c'=>'d' // this comment type causes Latte CompileException
]}

as usage example, i use array in layout latte to define linked js/css - i have a small fn made that goes over array and echoe link tags for js and css files, and also adds timestamp value if file is found - perfect for caching issues where js file linked without timestamp, may load old code, depending on cache settings of server. And it would be nice to add notes sometimes, about which file contains what or ahy added etc...