202 questions
0
votes
0
answers
53
views
How to Remove Unnecessary Slashes in Symfony Routing Generated Links
Symfony routing 5.4.48 (Without framework)
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\...
1
vote
3
answers
755
views
Define two routes with same base on Symfony
I have two routes GET /users/{id} and POST /users/{id}/file.
When I try to call the second one (POST /users/{id}/file), I get an error 405 Method Not Allowed.
I use Symfony 6.4.
My routes are defined ...
0
votes
0
answers
338
views
Symfony ignores routing and shows phpinfo
I'm new to Symfony and I'm trying to make a simple web page, afterinstalling docker, php 8.3 and composer, I downloaded a Symfony image (v5.4.20) and added doctrine to it
Now, both the database and ...
1
vote
0
answers
828
views
Symfony 6.3 Error unable to fetch the response from the backend when accessing dynamic route
I have a Symfony project in which all the routes work well except the only dynamic route service/{path}. I get the error "# unable to fetch the response from the backend: read tcp 127.0.0.1:52258-...
0
votes
2
answers
851
views
Check if URL is in use in Symfony
I need to check if entered value, e.g "specialist", is not in use as an URL in Symfony 6 application.
Simple ANY-method paths are simple:
/** @var RouterInterface $router */
$router->...
0
votes
0
answers
270
views
Incorrect routing via /config/routes.php in symfony 6.1
When I am defining routes in config/routes.php then those routes are not working in symfony 6.1
use App\Controller\BlogController;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;...
1
vote
1
answer
538
views
How can I change the routes for Taxons in sylius-standard?
I am trying to change the routes for my Taxons but cannot find a way to do it.
Current: {domain}/taxons/{taxon name}
Desired: {domain}/categories/{taxon name}
After searching Google/Stackoverflow I ...
5
votes
1
answer
1k
views
Named Routes in Symfony 6 with controllers in inner directory
I moved all my controllers to /src/Web/Controller in my Symfony 6 project like follows
├── src
│ ├── ...
│ └── Web
│ | ├── Controller
│ | ├── ....
| |── Kernel.php
my routes.yaml is ...
1
vote
1
answer
2k
views
Multiple subdirectories for controllers in annotations.yaml
I'm am trying to organize my controllers a bit more in a Symfony 5.3 application. They are in a couple of subdirectories and use annotations for their routing. Here are some samples:
../src/StuffA/...
0
votes
1
answer
312
views
Dynamic routing & templates in symfony
Recently while building my CMS in Symfony, I've run into a problem. I have 2 controllers, publicationcontroller and contactcontroller. In both controllers, an instance of the entity Page is loaded ...
2
votes
0
answers
317
views
Why Symfony generates route with kernel name?
I can't realize, why Symfony generates the route
kernel:
resource: ../../src/Kernel.php
type: annotation
I read documentation
https://symfony.com/doc/current/routing.html#creating-routes-as-...
0
votes
2
answers
235
views
Symfony 4 - User becomes null on callback from external API service
On Symfony 4, when catching a callback route from any external API service (in this case - Shopify API), my logged in user becomes anon.
(HTTP): Everything works when testing on localhost
(HTTPS): ...
1
vote
1
answer
173
views
route defined with negative lookaround matches the route despite the negative assertion
We want to open a DELETE endpoint that allows calls to all positive integers, but not id 1 (aka element 1 cannot be deleted)
Usually to open an endpoint that allows positive integers I configure the ...
0
votes
0
answers
54
views
How handle router with container's services/parameters dynamically?
I've used the Symfony route bundle and DI bundle in my non Symfony project.
I inject dependencies to the controllers/actions by the code below:
// Find the current route
$parameters = $router-&...
-1
votes
1
answer
845
views
Route not found/matched when using symfony 4 inside a subfolder
I have this apache server configured in mydomain.com/applications and inside that folder I have
/project1/ - using silex
/project2/ - using symfony 4
The server uses mod_rewrite and mydomain.com is ...
3
votes
1
answer
986
views
Symfony routing, separate route setup and ignore _locale prefix?
I have in my annotations.yaml following setup to use annotation route setup:
controllers:
resource: '../../src/Controller/'
type: annotation
prefix:
en: ''
sr: '/es'
...
5
votes
1
answer
4k
views
Why doesn't Symfony 5.1 recognize routes configured on a "routes.php" file?
I'm having a hard time trying to configure my routes using a config/routes.php file in Symfony 5.1.
As per the Symfony routing documentation, I should be able to configure my routes in a PHP file:
...
0
votes
0
answers
230
views
Symfony 2.8 how to get Route option
With EventListener I use my lass TransactionListener. This class check permission for current url. Some URL are open. I check it by attribut "option" in routing.yml
For getting option on current ...
4
votes
2
answers
986
views
Routing exception after upgrading to TYPO3 v9.5.14
After upgrading to TYPO3 v9.5.14 our detail pages for news crash with the exception
Symfony\Component\Routing\Exception\InvalidParameterException
Parameter "p88bd715a41119d0e8087a5d19cb049" for ...
0
votes
0
answers
1k
views
Validate optional input GET parameters passed in through the querystring as integers in Symfony 3.4
In Symfony 3.4, is there a way to validate optional input GET parameters passed in through the querystring as integers?
If provided, I am using the $ownerId and $courseId to query the corresponding ...
2
votes
2
answers
936
views
Symfony Always Include Route Default Values
So basically I am trying to achieve this: New in Symfony 4.3: Always Include Route Default Values
I have a task entity, which has multiple states like new, open & closed.
For this reason I am ...
-1
votes
2
answers
5k
views
How to generate an URL for a controller in Symfony?
I know how to generate an URL for a route. However now I need to generate an URL for a controller or for a controller with a method. I checked the sourced of UrlGenerator but did not find any relevant ...
1
vote
0
answers
387
views
TYPO3, routeEnhancers, rewrite simple url with parameters
In TYPO3 Version 9.5.11 I would like to have my own URL rewritten with GET parameters. The URL looks like this:
https://www.website.com/my-page/?logintype=login&dc=1246dh4bd6&code=...
3
votes
1
answer
1k
views
Migrating legacy project to Symfony routing issues
I'm trying to start migrating my legacy project to Symfony, piece by piece (Strangler Application). I followed this documentation, but I can only load my home URL / of my legacy application. Other URL'...
4
votes
1
answer
1k
views
Routing issue - every route matched with urlRedirectAction
I'm in the process of upgrading Symfony from 3.4 to 4.3 and I have a situation in which every route is matched with controller and method correctly, but then the request reaches ...