Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updated the Best Practices for Symfony 4 and Flex#8599

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@javiereguiluz
Copy link
Member

@javiereguiluzjaviereguiluz commentedNov 7, 2017
edited
Loading

Still WIP. Some chapters have not been reviewed yet.

Copy link
Member

@ycerutoyceruto left a comment

Choose a reason for hiding this comment

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

Nice! :)

Probably the section "Template Locations" needs changes too.

yield ['/post/fixture-post-1'];
yield ['/blog/category/fixture-category'];
yield ['/archives'];
yield [.];
Copy link
Member

Choose a reason for hiding this comment

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

yield [.] =>// ...?

@javiereguiluzjaviereguiluz changed the title(WIP) Updated the Best Practices for Symfony 4 and FlexUpdated the Best Practices for Symfony 4 and FlexNov 8, 2017
@javiereguiluz
Copy link
MemberAuthor

javiereguiluz commentedNov 8, 2017
edited
Loading

This is now ready for review. Here is the list of added/removed/changed best practices:

Added

  • Use the Symfony Skeleton to create new Symfony-based projects.
  • Use autowiring to automate the configuration of application services.
  • Don't add theAction suffix to the methods of the controller actions.

Removed

  • Don't define parameters for the classes of your services.
  • Create only one bundle called AppBundle for your application logic.

Changed

-Use the Symfony Installer to create new Symfony-based projects.+Use Composer and Symfony Flex to create and manage Symfony applications.
-Make your controller extend the FrameworkBundle base controller...+Make your controller extend the ``AbstractController`` base controller...
-Store the translation files in the ``app/Resources/translations/`` directory.+Store the translation files in the ``translations/`` directory at the root of your project.
-Store all your application's templates in ``app/Resources/views/`` directory.+Store the application templates in the ``templates/`` directory at the root of your project.
-Define your Twig extensions in the ``AppBundle/Twig/`` directory.+Define your Twig extensions in the ``src/Twig/`` directory.
-Store your assets in the ``public/`` directory.+Store your assets in the ``assets/`` directory at the root of your project.
-Use Assetic to compile, combine and minimize web assets, unless you're-comfortable with frontend tools like GruntJS.+Use `Webpack Encore`_ to compile, combine and minimize web assets.
-For fine-grained restrictions, define a custom security voter;-For restricting access to *any* object by *any* user via an admin-interface, use the Symfony ACL.+Define a custom security voter to implement fine-grained restrictions.

@xabbuhxabbuh added this to the4.0 milestoneNov 8, 2017
:doc:`Service autowiring</service_container/autowiring>` is a feature provided
by Symfony's Service Container to manage services with minimal configuration.
It reads the type-hints on your constructor (or other methods) and automatically
passes you the correct services. It can also add:doc:`service tags</service_container/tags>`
Copy link
Member

Choose a reason for hiding this comment

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

It passes the correct services to the methods, not 'you'.

javiereguiluz reacted with thumbs up emoji
simply ``Slugger::class`` if the class is already imported in your code).

Traditionally, the naming convention for a service was a short, but unique
snake case key - e.g. ``app.utils.slugger``. But for most services, you should now
Copy link
Member

Choose a reason for hiding this comment

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

I would remove this paragraph.

javiereguiluz reacted with thumbs up emoji
Use Composer and Symfony Flex to create and manage Symfony applications.

`Composer`_ is the package manager used by modern PHP application to manage their
dependencies. `Symfony Flex`_ is a Composer plugin designed to automatize some
Copy link
Member

Choose a reason for hiding this comment

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

automate?

javiereguiluz reacted with thumbs up emoji
`public checksums repository`_ and follow `these steps`_ to verify the
signatures.
The technical requirements to run Symfony are simple. If you want to check
if your system meets those requirements, read:doc:`/reference/requirements`.
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 recommending using thereq-checker for that?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Agree! The linked article (https://symfony.com/doc/master/reference/requirements.html) was revamped recently to remove everything and just explain how to use req-checker.

weaverryan added a commit that referenced this pull requestNov 10, 2017
This PR was merged into the 3.3 branch.Discussion----------Minor reword in autowiring introductionI used this in the reword of the Best Practices docs and Fabien [added this comment](#8599 (comment)) because he didn't like a phrase of this paragraph. This PR changes that too here.Commits-------c84cff8 Minor reword in autowiring introduction
Copy link
Member

@wouterjwouterj left a comment

Choose a reason for hiding this comment

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

Great stuff!

@weaverryan
Copy link
Member

This is huge work Javier. THANK YOU!!!

@weaverryanweaverryan merged commit335e461 intosymfony:masterNov 12, 2017
weaverryan added a commit that referenced this pull requestNov 12, 2017
…ereguiluz)This PR was squashed before being merged into the master branch (closes#8599).Discussion----------Updated the Best Practices for Symfony 4 and FlexStill WIP. Some controllers have not been reviewed yet.Commits-------335e461 Fixed after Fabien's review68b7a18 Fixed some missing references9794c0b Updated more contentsb997c1e Updated the Best Practices for Symfony 4 and Flex
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@wouterjwouterjwouterj approved these changes

+1 more reviewer

@ycerutoycerutoyceruto approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.0

Development

Successfully merging this pull request may close these issues.

8 participants

@javiereguiluz@weaverryan@fabpot@wouterj@yceruto@dmasior@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp