Symfony Flex Aliases Packs Recipes
... /twig-pack.
And that means that, in our composer.json file, we should now see
symfony/twig-pack under the require key. But if you spin over, it's not there!
Gasp! Instead, it added symfony/twig-bundle, twig/extra-bundle, and ...
... bundle v1.3.0 requires symfony/framework-bundle ~2.7|~3.3|~4.0 -> satisfiable by symfony/framework-bundle[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2 ...
Finding Using the Services from a Bundle
... and each of them gives us several services. But sometimes
you'll need a third party bundle like this one to get the job done. Typically,
you can just search online for the problem you're trying to solve, plus "Symfony ...
Bundle Config Configuring the Cache Service
... configuration.
Open the /config/packages directory. All of these .yaml config files are
automatically loaded into our Symfony application, and their job is to
configure services that each bundle gives us. In our homepage() method ...
The Great Hateoas PHP Library
... Google for "HATEOAS PHP" to find a fun library that a friend of mine made. This library
has a bundle that integrates it into Symfony: so click to view the BazingaHateoasBundle
and go straight to its docs. Before we talk ...
Is your Container Running Catch It lint:container
... Symfony's service container is special... like super-powers special. Why? Because
it's "compiled". That's a fancy way of saying that, instead of Symfony figuring
out how to instantiate each service at runtime, when you ...
Flex Extras
... Now that we're on Symfony 4 with Flex, I have three cool things to show you.
Start by opening GenusController: find listAction. Ah yes: this is a very
classic setup: get the entity manager, get the repository, then call ...
... /doctrine-fixtures-bundle ^3.1 -> satisfiable by doctrine/doctrine-fixtures-bundle[3.1.0].
- Conclusion: don't install symfony/framework-bundle v4.2.3
- Conclusion: don't install symfony/framework-bundle v4.2.2 ...
|
// ... lines 1 - 5
|
|
class AppKernel extends Kernel |
|
{ |
|
public function registerBundles() |
|
{ |
|
$bundles = array( |
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), |
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(), |
|
new Symfony\Bundle\TwigBundle\TwigBundle(), |
|
new Symfony\Bundle\MonologBundle\MonologBundle(), |
|
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), |
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), |
|
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), |
|
// ... lines 18 - 20
|
|
new AppBundle\AppBundle(), |
|
); |
|
|
|
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { |
|
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); |
|
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); |
|
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); |
|
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); |
|
} |
|
|
|
return $bundles; |
|
} |
|
// ... lines 33 - 52
|
|
} |
See Code Block in Script
|
{ |
|
// ... lines 2 - 3
|
|
"require": { |
|
// ... lines 5 - 20
|
|
"symfony/asset": "^4.0", |
|
"symfony/console": "^4.0", |
|
"symfony/flex": "^1.0", |
|
"symfony/form": "^4.0", |
|
"symfony/framework-bundle": "^4.0", |
|
"symfony/mailer": "4.3.*", |
|
"symfony/messenger": "4.3.*", |
|
"symfony/orm-pack": "^1.0", |
|
"symfony/security-bundle": "^4.0", |
|
"symfony/sendgrid-mailer": "4.3.*", |
|
"symfony/serializer-pack": "^1.0", |
|
"symfony/twig-bundle": "^4.0", |
|
"symfony/twig-pack": "^1.0", |
|
"symfony/validator": "^4.0", |
|
"symfony/web-server-bundle": "^4.0", |
|
"symfony/webpack-encore-bundle": "^1.4", |
|
"symfony/yaml": "^4.0", |
|
// ... lines 38 - 40
|
|
}, |
|
"require-dev": { |
|
// ... lines 43 - 45
|
|
"symfony/browser-kit": "4.3.*", |
|
"symfony/debug-bundle": "^3.3|^4.0", |
|
"symfony/dotenv": "^4.0", |
|
"symfony/maker-bundle": "^1.0", |
|
"symfony/monolog-bundle": "^3.0", |
|
"symfony/phpunit-bridge": "^3.3|^4.0", |
|
"symfony/profiler-pack": "^1.0", |
|
"symfony/var-dumper": "^3.3|^4.0" |
|
}, |
|
// ... lines 55 - 102
|
|
} |
See Code Block in Script
Blog
Bundles No Bundles and AppBundle in 10 Steps
... Symfony best practice instead of AppBundle? A few
reasons:
Without a bundle, you lose a few shortcuts, like the _controller shortcut
and the automatic bundle aliasing for entities (e.g. AcmeDemoBundle:Post).
All of these are ...
... If you can't install `symfony/stimulus-bundle` because of unresolved dependencies use this composer.json instead:
```
{
"type": "project",
"license": "proprietary",
"minimum-stability": "dev ...
Doctrine Extensions Sluggable and Timestampable
... The
StofDoctrineExtensionsBundle is what we want: it brings in that DoctrineExtensions
library and adds some Symfony glue to make things really easy. Click into
its documentation.
Installing a bundle is always the same ...
|
// ... lines 1 - 2
|
|
return [ |
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], |
|
Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], |
|
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], |
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], |
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], |
|
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], |
|
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], |
|
Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], |
|
]; |
See Code Block in Script
Finding Eliminating Deprecations
... app. So then, who is?
To find out, go to the command line and run:
composer why symfony/templating
Ah! This is required by knplabs/knp-time-bundle. Click the link to jump
to our ...
Flex Recipe Updates
... Let's commit
that... and update the next one.
Framework bundle! The core of Symfony! Run git diff --cached to see the
changes. Like Doctrine, most of these are low level where we opt into a
new behavior. For example ...
KnpMarkdownBundle Service
... Symfony is done by a service. And... who knows? Maybe Symfony
already has a service that parses markdown. At your terminal, let's find out. Run:
php bin/console debug:autowiring ...
... /"
}
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2 ...
... /master/composer.json ). stof/doctrine-extensions-bundle is fine now, so it stays as is. The whole composer.json for successful update for this tutorial:
```
{
"name": "symfony/framework-standard-edition",
"license ...
Hello Webpack Encore
... actually
install Encore. Nope, it installs a very small bundle called
webpack-encore-bundle, which helps our Symfony app integrate with
Webpack Encore. The real beauty is that this bundle has a very useful recipe.
Check it ...
1545
symfony bundle
Filter Results