Plugin Desgin & Integration w/ Component - Joomla! Forum - community, help and support
i've done lot of reading through documentation wiki , understand wiki not yet complete , being improved. still have questions regarding design patterns joomla 1.5 extensions.
in particular i'm working on new project consist of component , plugin. component used administration of media items can inserted content. plugin specific tags in content , insert media defined. idea media reused , updated across different content items without having update each content item.
the component begin designed around m-v-c pattern , should ready begin coding in week or so. wiki tutorial components useful , provided nice examples. plugin tutorial left me feeling lost. after examining plugins bunded latest 1.5 release questions have not been answered.
below few questions have , suggestions appreciated. project still in design (on paper no less!) stage , open changes.
1] there specific design pattern follow regarding plugins?
2] there way plugin access/use methods of component (i.e. via controller) content?
3] if data retrieved, modified , output in plugin accepted way design plugin? (i tend shy away all-in-one type scripts.)
i've noticed of bundled plugins have necessary functions in single php file. may because ported 1.0.x rather re-programmed 1.5 standards.
4] acceptable use multiple files separate code used plugin (i.e. file data models, file template use plugin script controller)?
5] additional resources (wiki's, forums, people contact) questions on design standards?
thank taking time assist me design standards current j! 1.5 project. can use forums answer questions or contact me directly email. have 12 hours per week earmarked project i'd work through design phase @ steady pace.
in particular i'm working on new project consist of component , plugin. component used administration of media items can inserted content. plugin specific tags in content , insert media defined. idea media reused , updated across different content items without having update each content item.
the component begin designed around m-v-c pattern , should ready begin coding in week or so. wiki tutorial components useful , provided nice examples. plugin tutorial left me feeling lost. after examining plugins bunded latest 1.5 release questions have not been answered.
below few questions have , suggestions appreciated. project still in design (on paper no less!) stage , open changes.
1] there specific design pattern follow regarding plugins?
2] there way plugin access/use methods of component (i.e. via controller) content?
3] if data retrieved, modified , output in plugin accepted way design plugin? (i tend shy away all-in-one type scripts.)
i've noticed of bundled plugins have necessary functions in single php file. may because ported 1.0.x rather re-programmed 1.5 standards.
4] acceptable use multiple files separate code used plugin (i.e. file data models, file template use plugin script controller)?
5] additional resources (wiki's, forums, people contact) questions on design standards?
thank taking time assist me design standards current j! 1.5 project. can use forums answer questions or contact me directly email. have 12 hours per week earmarked project i'd work through design phase @ steady pace.
after doing browsing in api , wiki enough informaiton gathered me 'play-coding' try different methods reach same result.
to answer question #2 - there way plugin access/use methods of component (i.e. via controller) content?
after trying several different methods decided using jloader class effective way reach component through plugin.
the jimport method looks classes in libraries directory. around used jloader class , used jpath_root base.
in controller class method written initiate action in model , view. method returns display output plugin. plugin replaces bracket tags found in article content display output component.
to answer question #2 - there way plugin access/use methods of component (i.e. via controller) content?
after trying several different methods decided using jloader class effective way reach component through plugin.
code: select all
//load class file com_hello component
jloader::import( 'components.com_hello.controller', jpath_root );
//instantiate com_hello controller
$hc = new hellocontroller();
//execute method use plugin
$jigrender = $hc->getjig( substr($jigparams[1],3) );
the jimport method looks classes in libraries directory. around used jloader class , used jpath_root base.
in controller class method written initiate action in model , view. method returns display output plugin. plugin replaces bracket tags found in article content display output component.
Comments
Post a Comment