[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] General configurations

A plastic example:
Most applications will have a graphic user interface where they manage persistent data (like articles, categories, etc.). If we see a form as an atomic element, there could be a versioned basic form with required fields, some behavioral information like which action to call or additional actions, and more. Not only that it could be extended by other forms, but also be forked to fit in another context. We were not forced to write the same code (create meta data, create form, create the markup, create logic like validations or other actions) all over again.
Imagine their would be a class "MyAppItemForm" which has all informations it needs for doing its job. It's extactly what some frameworks are doing with annotations. They write annotations and generate a "real class" which will be cached. But as i mentioned: Annotations doesn't seem right to me.

I don't know how else i could describe it. And of course i don't have a solution, that's the reason i thought it might be something where we can share our minds.

That to my mind would be best implemented in a HMVC framework. So you create a view to MyAppItemForm and then other views can call that same view. For example in the JED on the user profile page there is a series of sublist views rendered which show the user's extensions, their tickets etc. So in the ticket view we call:

// Load the MyExtension list_items layout and ask it to render as a partial, passing in an array of view options and model options (to filter the extensions by owner)

$modelVars           = array('clearfilters' => 1, 'filter' => array('core_created_user_id = ' . (int) $model->get('id')));
$this->extenionsView = FabrikHelpersView::load('Myextensions', 'list_items', 'partial', array('cols' => 3), $modelVars);

//html tmpl
echo $this->extenionsView->render();

Framework source code: https://github.com/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.