سؤال

I was wondering what is the difference between these two, besides the fact that elements are stored in separate files inside a specific folder, and blocks are defined within a view.

هل كانت مفيدة؟

المحلول

elements can be re-used to keep your code DRY (Don't repeat yourself)

blocks can be appended to inside your code, for instance you spit out the scripts block in your default lay-out. And in your views you place all your javascript into the scripts block, that way all your needed javascript will be included on your page in one place and you do not load more then you need to (views not being used at that time don't write javascript to the scripts block)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top