-
Notifications
You must be signed in to change notification settings - Fork 190
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
Conversation
* @param string $internal_name | ||
* @return mixed | ||
*/ | ||
public function getConfigEntityByInternalName($internal_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private
4cc03f2
to
77fc99c
Compare
/** | ||
* Generates the site config administration form and fills it with a default value if needed. | ||
* | ||
* @Route(path="/", name="KunstmaanConfigBundle_settings_configs") |
There was a problem hiding this comment.
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
77fc99c
to
ca9c7da
Compare
|
||
if ($entity->getInternalName() == $internalName) { | ||
$repo = $this->em->getRepository($class); | ||
$config = $repo->findOneBy(array()); |
There was a problem hiding this comment.
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.
ca9c7da
to
8f5c60a
Compare
@@ -0,0 +1,4 @@ | |||
kunstmaanconfigbundle_default: | |||
resource: "@KunstmaanConfigBundle/Controller/ConfigController.php" |
There was a problem hiding this comment.
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
8f5c60a
to
f70828e
Compare
[ConfigBundle]: cleanup [ConfigBundle]: remarks fixes Save configs into array [ConfigBundle]: change configcontroller to service Adding docs in root
f70828e
to
aac8d0b
Compare
[ConfigBundle]: add new configuration bundle
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.