尝试安装(在更新composer之后): composer create-project symfony-cmf/sandbox cmf-sandbox 我有这些错误: Installing symfony-cmf/sandbox (2.0.0)
- Installing symfony-cmf/sandbox (2.0.0): Loading from cache
Created project in cmf-sandbox
Loading composer repositories with package information
Installing dependencies (i
我正在Debian7.0系统上用NetBeans8.0开发一个更大的symfony2应用程序。我为助手类和服务编写了许多单元测试,它们在netbeans和命令行中运行良好。但是我也想测试控制器,所以我编写了我的第一个"WebTestCase“派生类:
<?php
namespace StockCrawler\MainBundle\Tests\Services;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class TestFrontpageController extends WebTestCase {
p
我正试着让symfony cmf启动并运行。在安装过程中遇到了几个问题之后,我被这个错误消息困住了:
Catchable fatal error: Argument 1 passed to Symfony\Cmf\Component\Routing\ContentAwareGenerator::getBestLocaleRoute() must be an instance of Symfony\Component\Routing\Route, instance of Doctrine\ODM\PHPCR\Document\Generic given, called in D:\wamp\ww
我一直试图使Symfony不使用URL路径中的区域设置来处理请求。
我跟踪了很多这样的答案,让我走得很远。
我在登录事件上获取用户的语言偏好,并将其设置为会话。然后,对于每个请求,我都有这个事件侦听器:
<?php
namespace My\UserBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSu
我试图在Symfony中设置一个区域设置,除了在布局文件中尝试翻译或生成路由的位置之外,一切正常工作。我创建了一个侦听器,以便在每个请求上设置区域设置。
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\DependencyInjection\ContainerInte
每次我运行composer命令将Drupal 8.9.16升级到Drupal 9时,它都会通知我模块有问题。
例如,我运行:
composer require drupal/core --with-all-dependencies
我得到:
Using version ^9.2 for drupal/core
./composer.json has been updated
Running composer update drupal/core --with-all-dependencies
Gathering patches from patch file.
Loading composer
<?php
declare(strict_types=1);
namespace App\Controller\User;
use App\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use
在Ubuntu 18.04中,我安装了php。我通过index.php测试确认了它的有效性。我现在尝试安装composer
composer install
但下面显示了错误:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
-
我正在尝试使用背景图像模块,但它注册的生成CSS的动态路由似乎存在问题。我一直在调试它,但我碰到了一堵墙。它基本上是核心图像模块的路由设置的复制,所以我不确定出了什么问题,但是控制器方法从不触发;控制器甚至没有被实例化。下面是配置文件:
route_callbacks:
- '\Drupal\background_image\Routing\BackgroundImageRoutes::routes'
下面是routes方法:
public function routes() {
error_log('Router::routes');
我正在尝试在一个新的FOSUserBundle项目上安装symfony2。我已经按照步骤安装了它,但是仍然遇到了这个错误:
FileLoaderImportCircularReferenceException in FileLoader.php line 97:
Circular reference detected in "/Users/tom/Sites/symfony/todo/app/config/routing_dev.yml" ("/Users/tom/Sites/symfony/todo/app/config/routing_dev.yml" &g
我更新了我的网站从Symfony 3.4到Symfony 4,并做了一些改变。但我知道我有个错误:
您已经请求了一个不存在的服务"D".
这里我的堆栈跟踪:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
You have requested a non-existent service "D".
at vendor\symfony\dependency-injection\Container.php:263
at Symfony\Component\D
在我的Symfony2项目中,我有一个有帖子的新闻网站。这些文章可以在不同区域发表。当前区域(用户选择)必须是url的一部分。所以URL应该如下所示:
/mag => main news site, no region selection
/mag/region1/ => posts for region 1
/mag/region2/ => ...
/mag/region1/my-news-post-slug => detail view of one post
对于新闻帖子,我使用了。
现在我的问题是,如何将用户的区域选择添加到路由系统中,而不必更改我使用的包的每个
我有一个Silex错误,重复4次。我想解决或隐藏它。否则,页面将正常加载。
Symfony\Component\Routing\Exception\ResourceNotFoundException: in /var/www/project/vendor/symfony/routing/Symfony/Component/Routing/Matcher/UrlMatcher.php on line 96
其次是:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET
我正在使用laravel 4.2。我的项目在xampp installation上运行,我的database是mysql/phpmyadmin。我已经安装了ide helper plugin from barryvdh。安装插件后,我的vendor/symfony/routing/Symfony/Component/Routing中出现了一些奇怪的错误。
cvc-complex-type.2.4.a: Invalid content was found starting with element 'foo'. One of '{"http://symfony.c
我已经在这里尝试过了,https://symfony.com/doc/master/components/routing.html,但是我做不到。 <?php
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Bundle\FrameworkBundle\Routing\AnnotatedRouteControllerLoader;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Routing\Loader\AnnotationDi
我正在使用Symfony2中的DDD,我添加了以下控制器:\src\Coredomain\Companies\RestBundle\Controller\CompanyController.php
namespace Coredomain\Companies\RestBundle\Controller;
use [...] ;
class CompanyController
{
public function indexAction()
{
return $this->render('default/index.html.twig');
我正在使用这个捆绑包在我的网站与Symfony2和有一些问题,没有翻译的路由。
例如:http://en.site.com/home -> is correct and it works. -http://es.site.com/inicio -> is correct and it works.现在问题来了,把两者结合起来就像:-es.site.com/home -> not correct but it works. -en.site.com/inicio -> not correct but it works.
config.yml为:jms_i18n_routi
我有一个集成了FOSUserBundle的Symfony 2.5项目。我希望任何登录的用户与X的应用程序上的空闲时间被自动注销,并重定向到登录页面。
到目前为止,我已经实现了一个解决方案,它与here 上的建议非常相似
<?php
namespace MyProject\UserBundle\EventListener;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFounda
在symfony上进行用户身份验证时遇到了问题。我的login_path工作正常,但check_path出现故障。我指定的路径提供了著名的Unable to find the controller for path "/login_check". Maybe you forgot to add the matching route in your routing configuration?
我看过其他的帖子,他们似乎都在做我正在做的事情。我是symfony的新手,在掌握这些概念方面有困难,所以我非常感谢一些帮助。
我正在使用Symfony 2.1,如果这有区别的话。
我相信我