Recommended location for a php function to be used by a custom template in a Package
Permalink
Hi guys,
Where should functions needed by custom templates included in a package for blocks be placed in concrete 5.7?
As an example lets say I wanted to add a truncate text function for a custom template for the page list block, where should I place my function so its available in the view.php template?
Martin
Where should functions needed by custom templates included in a package for blocks be placed in concrete 5.7?
As an example lets say I wanted to add a truncate text function for a custom template for the page list block, where should I place my function so its available in the view.php template?
Martin
Otherwise, create a class somewhere under package_name/src/ and instantiate the class.
You may need to read up on the autoloader so you can then load the class. Its finicky and has changed to become more so in 5.7.4.