1545 search results for symfony bundle

Hi Victor, Nice to read you. Yeah i finally fixed my issue by replacing "Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" with "Symfony\Component\Routing\Annotation\Route" class which is really cool. Thanks for your assistance. ...
Hey there After you did what that error occurred? If it happend after trying to render a Twig's template, probably you forgot to extend from Symfony's Abstract controller. Add this import to your class `Symfony\Bundle\FrameworkBundle\Controller\AbstractController` Cheers! ...
MolloKhan
MolloKhan
Read Full Comment
Hi Apr In Symfony 4 you can override bundle templates by putting them into /templates/bundles//. For more information check this doc page https://symfony.com/doc/current/bundles/override.html#templates Hope this will help. Cheers! ...
... Ah, yes, that's a deprecation about using "Routing annotations" I believe you just have to change the import from "Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" to "Symfony\Component\Routing\Annotation\Route" ...
MolloKhan
MolloKhan
Read Full Comment
Want to share my experience, SF 4.1.2 Deprecation Message: User Deprecated: The "Sensio\Bundle\FrameworkExtraBundle\Configuration\Route" annotation is deprecated since version 5.2. Use "Symfony\Component\Routing\Annotation\Route" instead. The solution is pretty obvious, choose the other Route Class :) ...
19 lines | tests/Controller/MainControllerTest.php
// ... lines 1 - 2
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class MainControllerTest extends WebTestCase
{
public function testGetGitHubOrganization()
{
$client = static::createClient();
$client->request('GET', '/api/github-organization');
$this->assertResponseIsSuccessful();
$data = json_decode($client->getResponse()->getContent(), true);
$this->assertArrayHasKey('organization', $data);
}
}
See Code Block in Script
18 lines | tests/SecurityControllerTest.php
// ... lines 1 - 2
namespace App\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class SecurityControllerTest extends WebTestCase
{
public function testSomething()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertResponseIsSuccessful();
$this->assertSelectorTextContains('h1', 'Hello World');
}
}
See Code Block in Script
// ... lines 1 - 2
namespace App\Controller;
use App\SomeFormType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class ContainerTestController extends AbstractController
{
public function test()
{
$form = $this->createForm(SomeFormType::class);
// error will happen on previous line
}
}
See Code Block in Script
26 lines | src/Controller/ArticleController.php
// ... lines 1 - 4
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class ArticleController
{
// ... lines 10 - 17
/**
* @Route("/news/why-asteroids-taste-like-bacon")
*/
public function show()
{
return new Response('Future page to show one space article!');
}
}
See Code Block in Script
// ... lines 1 - 7
use Symfony\Bundle\SecurityBundle\Security;
// ... lines 9 - 13
class DragonTreasureEntityToApiMapper implements MapperInterface
{
public function __construct(
// ... line 17
private Security $security,
)
{
}
// ... lines 22 - 33
public function populate(object $from, object $to, array $context): object
{
// ... lines 36 - 47
$dto->isMine = $this->security->getUser() && $this->security->getUser() === $entity->getOwner();
// ... lines 49 - 50
}
}
See Code Block in Script
22 lines | docker-compose.yml
version: '3'
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-13}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}
POSTGRES_USER: ${POSTGRES_USER:-symfony}
volumes:
- db-data:/var/lib/postgresql/data:rw
// ... lines 14 - 22
See Code Block in Script
// ... lines 1 - 22
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator;
use Symfony\Component\HttpFoundation\RequestStack;
// ... lines 25 - 27
class QuestionCrudController extends AbstractCrudController
{
private AdminUrlGenerator $adminUrlGenerator;
private RequestStack $requestStack;
public function __construct(AdminUrlGenerator $adminUrlGenerator, RequestStack $requestStack)
{
$this->adminUrlGenerator = $adminUrlGenerator;
$this->requestStack = $requestStack;
}
// ... lines 38 - 216
}
See Code Block in Script
... framework itself its bundle infrastructure. If Symfony 3.0 supports a monolithic app structure natively with all the bells and whistles, I'm all for it. But for Symfony 2.x, all of this feels quite forced and does not ...
meandmymonkey
meandmymonkey
Read Full Comment
Hi there, I can't use @Security("") :( I am using symfony 3.4 LTS and I have already run: $ composer require sensio/framework-extra-bundle $ composer require symfony/expression-language v3.4.1 But now when I want to ...
... But my base is empty except this table. As Ryan said I didn't put a version number and let the installation do its job. My composer.json says... "doctrine/doctrine-migrations-bundle": "^1.2" and for symfony "symfony/symfony": "3.2.*" ...
Céline Ollagnier
Céline Ollagnier
Read Full Comment
... /symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php#L232-L249 . To get a raw HTML is useful for rendering a mail body which you will send to user, etc. Cheers
... then you need to add @Annotation to the _class_ doc comment of "Symfony Contracts Service Attribute Required". If it is indeed no annotation, then you need to add @IgnoreAnnotation("required") to the _class_ doc comment of method Symfony\Bundle\FrameworkBundle\Controller\AbstractController::setContainer()in
... /my_project/bin/console:8 Stack trace: #0 {main} thrown in /home/user/my_project/bin/console on line 8 After running **composer require symfony/runtime** I get this one. Problem 1 - Root composer.json requires nexylan/slack-bundle ^2.0,
Oleg-Okhrimenko
Oleg-Okhrimenko
Read Full Comment
... to create a recipe and Symfony Flex will automatically copy your import file for routes to their project. You can push a recipe for your bundle to this repo: https://github.com/symfony/recipes-contrib :) I hope this helps! Cheers!
Hey Charlotte, Yes, from the error you can see that to be able to install liip/imagine-bundle v2.3.0 you will need to be on Symfony 4.3 or higher at least. As I see from the output, your Symfony version is 4.2. So ...