akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Added Service to the container to easily get the component's params from Configuration #527

Closed Skullbock closed 9 years ago

Skullbock commented 9 years ago

Taken directly from AkeebaSubs 5.0

Example:

$apiKey = $this->container->params->get('api_key', false);
$this->container->params->set('api_key', '1bcde');
$this->container->params->setParams(array('param1' => '123', 'param2' => '345'));
nikosdion commented 9 years ago

I love the idea ofnsuch a service but we need to improve it a bit.

Loading the component parameters should be a public function reload() instead of hard-coded in the constructor. The constructor would call it, but the developer can force reload the parameters if need be.

Setting and saving the parameters should be two different methods, set() and save().

If you can please do that I will be more than happy to include these features in FOF :)

Skullbock commented 9 years ago

Like this?

nikosdion commented 9 years ago

Exactly! When you have some time can you document it on the wiki?

Skullbock commented 9 years ago

Sure. New page or in the Container page?

nikosdion commented 9 years ago

New page, but link to it from the Container documentation

Skullbock commented 9 years ago

Done!

nikosdion commented 9 years ago

Thank you!