سؤال

I'd like to develop a module as an event with registration form. An event is actually a page module with slight modification by adding some fields such registration form url. When the controller return a view, I'd like the controller to return a registration form widget along with the event info (article) and a google maps widget.

Imagine a widget class:

<?php
    class Registration_Form_Widget extends Widget{
       ......
   }

My question is: Is it possible to create widget dynamically (I mean the creation of widget instance is dynamic (not the content) such using new Registration_Form_Widget and bypass the parameter such the registration form url that has been stored to the database?

So far, I never see an example that show how to create widget instance dynamically with automatic increment id

thanks...

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

المحلول

Nope, widgets are created whenever you create em.

نصائح أخرى

Although it is obviously possible to achieve it with a bit of code. There is no "magic function" to do that automatically, but you can look into the widget module files to understand what is done when a user create a widget in the admin CP. And then you could reproduce the behaviour yourself.

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