+1 (001) 555-44-33
English

New modular widgets system

05.06.2015

Here is the new features of YonaCMS - "System of modular widgets".

Now, in any of your modules, you can create dynamic widgets with their business logic and templates. Forget about dozens of separate helper and the need to do the same routine operations! Also, this scheme will maintain cleanliness and order in the code for your project.

Call each widget can be produced directly from the template Volt with the transfer set of parameters. Each widget is automatically cached and does not lead to additional load on the database. Caching can be disabled in the administrative panel, see Admin -> Settings, option "Widgets caching". Automatic regeneration of the cache is carried out after 60 seconds.

As an example of such a call is made to the widget template's main page /app/modules/Index/views/index.volt

{{Helper.widget ('Publication'). LastNews ()}}


Files widget:
/app/modules/Publication/Widget/PublicationWidget.php - inherits \ Application \ Widget \ AbstractWidget
/app/modules/Publication/views/widget/last-news.volt - template output

The main class of the widget - \ Application \ Widget \ Proxy
It is possible to set the default value for time caching.

This system will be very useful for developers who have a lot of individual information units, as well as those who want to keep your code clean and easy tool to use.

← Back to publications list
Profiler
  • Total SQL queries: 3
  • Total SQL elapsed seconds: 0.71 ms
  • Memory usage: 1.25 Mb