Skip to content

Rewrote Extension & Configuration docs #3894

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

Merged
merged 1 commit into from
Aug 16, 2014
Merged

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented May 30, 2014

The "How to expose semantic configuration for a bundle" article always was a bit of a mess. It tried to explain how to use Extension classes to load service definitions and how to provide configuration options for a bundle. At the same time it showed 2 ways to achieve this goal: a simple way and the official way. This resulted in an article that wasn't easy to follow and did not really learn anything about Extensions and Configurations.

So I decided to rewrite the complete article into 2 seperate articles: One about the Extension and one about the Configuration.

While I was doing that, I discovered it was time that we rewrote this thing. Most of the article was written in Feb 2011 and was outdated now.

I've also added a section about XML configuration.

This is a first sketch, I haven't checked my english/grammar/typos, but it's ready to catch the first comments!

Q A
Doc fix? yes
New docs? yes
Applies to 2.3+
Fixed tickets -

Side-note: I have discussed with myself to move the article to the components docs, because most of it doesn't rely on the Symfony framework. However, since the conventions do, I decided to keep it in the cookbook to make it easier to follow.

@@ -445,6 +447,8 @@ a second argument::
->fixXmlConfig('child', 'children')
->children()
->arrayNode('children')
// ...
->end()
->end()
;
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about moving the semicolon to the line above?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think the place is right imo. It helps the reader's brain to start where it left. Things like this make sense imo more than what the standard says, but oh well.

@cordoval
Copy link
Contributor

cordoval commented Jun 3, 2014

good job @wouterj I will now stop and cook you again when i get a chance. These simplifications and tips are a great addition!

single: Configuration; Semantic
single: Bundle; Extension configuration

How to Expose Semantic Configuration for a Bundle
Copy link
Member

Choose a reason for hiding this comment

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

Should be "How to Expose a Semantic Configuration" or "How to Expose Semantic Configurations".

Copy link
Member

Choose a reason for hiding this comment

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

What about...

How to Create Friendly (Semantic) Configuration for your Bundle

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 let's remove those non-basic english words from the docs :)

@wouterj
Copy link
Member Author

wouterj commented Jun 14, 2014

Thanks @xabbuh @cordoval @stof! I've applied everything I agreed with and commented on the others

single: Configuration; Semantic
single: Bundle; Extension configuration

How to Create Friendly Configuration for a Bundle
Copy link
Member

Choose a reason for hiding this comment

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

friendly

Copy link
Member Author

Choose a reason for hiding this comment

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

You can say "very friendly", so friendly is not a closed-class word

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure? To me, very friendly are two words and is not a modification of friendly.

Copy link
Member Author

Choose a reason for hiding this comment

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

"very" is an adverb that says something about the "friendly" abverb. So the "friendly" word is extended using "very". If a word can be extended, it isn't closed-class.

I may be wrong, let's see what @weaverryan thinks

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'm curious what @weaverryan thinks about this.

Copy link
Member

Choose a reason for hiding this comment

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

Haha, you guys are great. This is so technical, that I'm no more qualified than you guys are here - I'm also just reading on the web :). @wouterj's description makes sense to me.

--------------

Symfony allows people to provide the configuration in three different formats:
Yaml, XML and PHP. Yaml and PHP both use the same syntax and are supported by
Copy link
Member

Choose a reason for hiding this comment

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

Both YAML and PHP use [...]

@ghost
Copy link

ghost commented Jul 27, 2014

i just got seriously bitten by this information being out of date. Anything small i can do to get this merged?

@wouterj
Copy link
Member Author

wouterj commented Jul 27, 2014

@jrobeson exactly what you did now: Making me aware that I need to do some things.

Oh, and creating a time machine for @weaverryan so he has some time to review this.

@ghost
Copy link

ghost commented Jul 27, 2014

thanks @wouterj!

specifically i got bit by the part about using getConfigurationExtension() vs the old way $container->registerExtension()

make use of :ref:`parameters <book-service-container-parameters>`, then
you still have the flexibility to customize your bundle from your application
configuration. See ":ref:`service-container-imports-directive`" for more
details.
Copy link
Member

Choose a reason for hiding this comment

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

I like what we're saying here, but I'm not sure its as clear as I want. I basically want to say (not word-for-word, just an idea):

Unless you're building a bundle you plan to release open source of share between projects, don't follow this guide. Just create services in services.yml and be done.

If we talk parameters, I want to keep it short, so that we don't cloud this message:

If you do want to be able to configure something from within config.yml, you can always create a parameter there and then use it somewhere else.

Copy link
Member Author

Choose a reason for hiding this comment

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

I get what I mean, I reduced it quite a lot now.

@ghost
Copy link

ghost commented Aug 15, 2014

just had to explain this issue to another person. Is there anything i can do to help with this?

@weaverryan
Copy link
Member

Thanks for the great work Wouter and sorry for my slow merge!

@weaverryan weaverryan merged commit c9fe05b into symfony:2.3 Aug 16, 2014
weaverryan added a commit that referenced this pull request Aug 16, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

Rewrote Extension & Configuration docs

The "How to expose semantic configuration for a bundle" article always was a bit of a mess. It tried to explain how to use Extension classes to load service definitions and how to provide configuration options for a bundle. At the same time it showed 2 ways to achieve this goal: a simple way and the official way. This resulted in an article that wasn't easy to follow and did not really learn anything about Extensions and Configurations.

So I decided to rewrite the complete article into 2 seperate articles: One about the Extension and one about the Configuration.

While I was doing that, I discovered it was time that we rewrote this thing. Most of the article was written in Feb 2011 and was outdated now.

I've also added a section about XML configuration.

This is a first sketch, I haven't checked my english/grammar/typos, but it's ready to catch the first comments!

| Q   | A
| --- | ---
| Doc fix? | yes
| New docs? | yes
| Applies to | 2.3+
| Fixed tickets | -

Side-note: I have discussed with myself to move the article to the components docs, because most of it doesn't rely on the Symfony framework. However, since the conventions do, I decided to keep it in the cookbook to make it easier to follow.

Commits
-------

c9fe05b Rewrote Extension & Configuration docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants