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

[4.0] Setup & Page Creation updates#8544

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

Closed
weaverryan wants to merge6 commits intosymfony:masterfromweaverryan:new-flex-setup
Closed

[4.0] Setup & Page Creation updates#8544

weaverryan wants to merge6 commits intosymfony:masterfromweaverryan:new-flex-setup

Conversation

@weaverryan
Copy link
Member

Hi guys!

I'm currently re-reading the most important changes and updating for 4.0 (probably, we need to do a scripted find-replace for the biggest changes (e.g.AppBundle ->App,app/config/config.yml to... other things) for the bulk of the chapters.

I'm already continuing with routing and other chapters, but wanted to get this PR at least submitted as soon as possible.

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

Nice changes! Thanks for this.

resource:../src/Controller/
type:annotation
After this one-time setup, you can nowadd your route directly *above* the controller:

Choose a reason for hiding this comment

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

nowadd ->now add


Second, after this package was downloaded, Flex executed a *recipe*, which automatically
enabled the bundle. Flex recipes exist for many packages (not just bundles) and have
have the ability to do a lot, like adding configuration files, creating directories,

Choose a reason for hiding this comment

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

have is repeated at the end of the previous line.

Finally, templatefilesshouldlive in the ``app/Resources/views`` directory. Create
a new ``app/Resources/views/lucky`` directory with a new``number.html.twig`` file
inside:
Templatefiles live in the ``templates/`` directory, which was created for your automatically

Choose a reason for hiding this comment

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

for your ->for you

that is *not* PHP code goes here.
``config/``
Contains...configurationof course!. You will configure routes,:doc:`services</service_container>`
and pckages.

Choose a reason for hiding this comment

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

pckages ->packages

``var/``
This is where automatically-created files are stored, like cache files
(``var/cache/``), logs (``var/logs/``) and sessions(``var/sessions/``).
(``var/cache/``) andlogs(``var/logs/``).

Choose a reason for hiding this comment

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

Be careful!!var/logs/ is now calledvar/log/ Seesymfony/recipes#169

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oh! I hadn't even realized! Thanks :)

Copy link
Member

Choose a reason for hiding this comment

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

do you need some hand? see#8547 ;)

setup.rst Outdated
cache, logs)tothe repository, so you'll have to do the following when
installing an existing Symfony application:
If you're working on an existing Symfony application, you'll just need to do a few
thingstoget your project setup. Assuming your team uses git, you can setup your

Choose a reason for hiding this comment

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

git ->Git


Before diving into this, test it out! If you are using PHP's internal web server
go to:
To map a URL to this controller, create a route in ``config/routes.yaml``:

Choose a reason for hiding this comment

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

I just wonder if this is too advanced to be understood by someone who is starting with Symfony:

To map a URL to this controller, create a route in ``config/routes.yaml``:

Would something like this be better ... or just more verbose and complicated?

Now you need to associate this controller with a public URL so the ``number()``method is executed when users browse some URL (e.g. ``/lucky/number``). Thisassociation is defined creating a **route** in the ``config/routes.yaml`` file:

First, ``annotations`` isn't a real package name: it's an *alias* (i.e. shortcut)
that Flex resolves to ``sensio/framework-extra-bundle``.

Second, after this package was downloaded, Flex executed a *recipe*, which automatically
Copy link
Member

@javiereguiluzjaviereguiluzOct 24, 2017
edited
Loading

Choose a reason for hiding this comment

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

In this paragraph I'm missing a simple description of what a recipe is. If you agree, I propose something like:"a set of automated instructions that tell Symfony how to integrate some external package".

Besides, this paragraph is the only one mentioning "bundles" ... and it's strange because we don't introduce that concept anywhere in this article. I propose to remove all references about bundles.

So this is how it'd look:

Second, after this package was downloaded, Flex executed a *recipe*, which is aset of automated instructions that tell Symfony how to integrate some externalpackage. Flex recipes exist for many packages and have the ability to do a lot,like adding configuration files, creating directories, updating ``.gitignore``and adding new config to your ``.env`` file. Flex *automates* the installationof packages so you can get back to coding.

There is also a ``.env`` file which is loaded. Its contents become environment variables
in the dev environment, making it easier to reference environment variables in your
code.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This will be covered more#8546. I just bootstrapped this section so that I could link to it.

@weaverryanweaverryan added this to the3.4 milestoneOct 24, 2017
@weaverryan
Copy link
MemberAuthor

All comments addressed!


Second, after this package was downloaded, Flex executed a *recipe*, which is a
set of automated instructions that tell Symfony how to integrate an external
package. Flex recipes exist for many packages (not just bundles) and have the

Choose a reason for hiding this comment

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

One last comment on my side. In this paragraph we mention "bundles" for the first time and without prior introduction ("[...] Flex recipes exist for many packages (not just bundles) and have [...]"). Given that bundles are not important in this article, we could remove this mention. Thanks!

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.

Mostly minor CS things

$ composer require annotations
Then, in ``config/routes.yaml``, remove the route we just created and uncomment
Copy link
Member

Choose a reason for hiding this comment

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

No first person in the docs

..code-block::diff
// src/Controller/LuckyController.php
// ...
Copy link
Member

Choose a reason for hiding this comment

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

this and the empty line below should be swapped (minor)

you can get back to coding.

You can learn more about Flex by reading ":doc:`/setup/flex`". But that's not necessary:
Flex works automatically in the background when you add packages.
Copy link
Member

Choose a reason for hiding this comment

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

This is probably the time to link tohttp://symfony.sh ?

You can learn more about Flex by reading ":doc:`/setup/flex`". But that's not necessary:
Flex works automatically in the background when you add packages.

The bin/console Utility
Copy link
Member

Choose a reason for hiding this comment

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

The console utility?


..code-block::terminal
php bin/console
Copy link
Member

Choose a reason for hiding this comment

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

Commands have to be prefixed by$ (otherwise, the parser won't understand it)


..code-block::terminal
php bin/console debug:router
Copy link
Member

Choose a reason for hiding this comment

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

same here

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@wouterjwouterjwouterj requested changes

+1 more reviewer

@ycerutoycerutoyceruto left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@weaverryan@javiereguiluz@wouterj@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp