smarty icon indicating copy to clipboard operation
smarty copied to clipboard

Object properties cannot be called directly after a method

Open ghost opened this issue 4 years ago • 2 comments
trafficstars

<p>{{ hello()->total() }}</p>

hello()The method returns an object

ghost avatar Aug 16 '21 00:08 ghost

While this is a valid PHP construct, you have to keep in mind that Smarty is not a general purpose programming language. There's still ways to amend your issue, but I suggest you reconsider your practices in the first place.

AnrDaemon avatar Oct 13 '21 18:10 AnrDaemon

While this is a valid PHP construct, you have to keep in mind that Smarty is not a general purpose programming language. There's still ways to amend your issue, but I suggest you reconsider your practices in the first place.

I think you're right, but I also have the idea that such a structure can be developed more conveniently. The conclusion is that laravel's balde engine does have such a syntax. I like Smarty very much. If possible, I sincerely hope to add such a feature and expect your reply. Is it possible to realize it in the future?

ghost avatar Nov 21 '21 09:11 ghost