Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ConfigBundle]: add new configuration bundle #1053

Merged
merged 1 commit into from
Mar 8, 2016

Conversation

sandergo90
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets

This bundle allows you to create a entity that extends the AbstractConfig class.
By doing this you can create a settings form with some custom configuration variables.

* @param string $internal_name
* @return mixed
*/
public function getConfigEntityByInternalName($internal_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

/**
* Generates the site config administration form and fills it with a default value if needed.
*
* @Route(path="/", name="KunstmaanConfigBundle_settings_configs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

internal_name should be a clean routing parameter not in query string


if ($entity->getInternalName() == $internalName) {
$repo = $this->em->getRepository($class);
$config = $repo->findOneBy(array());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For performance, I would store the retrieved config so when get_config is called again for the same internal name it doesn't trigger the query again.

@@ -0,0 +1,4 @@
kunstmaanconfigbundle_default:
resource: "@KunstmaanConfigBundle/Controller/ConfigController.php"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better controller as service, so it is easy to override the controller class if needed

[ConfigBundle]: cleanup

[ConfigBundle]: remarks fixes

Save configs into array

[ConfigBundle]: change configcontroller to service

Adding docs in root
jockri pushed a commit that referenced this pull request Mar 8, 2016
[ConfigBundle]: add new configuration bundle
@jockri jockri merged commit 8c7133f into Kunstmaan:sf3 Mar 8, 2016
@jockri jockri added this to the 4.0.0 milestone Mar 8, 2016
@sandergo90 sandergo90 deleted the kuma-configbundle branch July 7, 2016 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants