自过去几个月以来,我一直在尝试与 symfony 合作。昨晚我做了一个自动删除来清除不需要的存储库。之后,我无法使用 symfony 命令创建新的 symfony 项目。当我Symfony new SecurityDemo 2.8.1在终端中运行时,出现错误
Symfony: command not found
Run Code Online (Sandbox Code Playgroud)
我尝试按照文档http://symfony.com/doc/current/setup.html 中的指示再次安装Symfony 安装程序。我转到我的根目录并按照屏幕截图所示的安装过程进行操作

我仍然得到同样的错误。
感谢所有帮助。
编辑:
我正在使用 LAMP 并使用 PHP 5.6。
当我尝试使用更新 symfony 安装程序时,symfony self-update我得到输出
// Symfony Installer is already updated to the latest version (1.5.8).
Run Code Online (Sandbox Code Playgroud) 我正在使用两个 ManyToMany 相关实体,即category和tag。
实体Tag(相关详情):
/**
*
* @var string
*
* @ORM\Column(name="tagname", type="string")
*/
protected $tagname;
/**
* @ORM\ManyToMany(targetEntity="Category", mappedBy="tags")
*/
protected $categories;
Run Code Online (Sandbox Code Playgroud)
实体类别(相关详情):
/**
*
* @var string
*
* @ORM\Column(name="CategoryName", type="string",length=200)
*/
protected $categoryname;
/**
* @ORM\ManyToMany(targetEntity="Tag", inversedBy="categories")
*/
protected $tags;
Run Code Online (Sandbox Code Playgroud)
我有一个带有选择输入(CategoryType)和多个选择输入(TagType)字段的表单。这两个字段都是 EntityType 字段。TagType 嵌入在 CatgoryType 中。
为此,我无法利用该cascade=persist功能,而是在我的控制器中手动添加提交的标签。提交时,表单数据会被持久保存在数据库中,没有任何问题。
问题是,提交后,当我在控制器中获取提交的类别(和相关标签)并将其传递给表单时,出现此错误 - Unable to transform value for property path "tagname": Expected a Doctrine\Common\Collections\Collection object.
获取的类别 object( var_dump($category->getTags()->getValues());)的 var_dump 结果为我提供了一个关联 Tag 对象的数组,其属性为 …
当我尝试使用错误的凭据登录时,它会显示"再次尝试,错误的凭据",但在输入正确的凭据后,它会显示错误找不到"GET /"的路由(来自" http:// localhost/bdayProj/web/app_dev. php/login ").以下是我的security.yml的配置
security:
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager
logout: true
anonymous: true
# activate different ways to authenticate
# http_basic: ~
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
# form_login: ~
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } …Run Code Online (Sandbox Code Playgroud) 我正在一个网页上工作,我在那里使用CSS样式表而不是内联样式.问题是,当我检查页面的chrome中的元素时,我可以看到几乎所有元素都继承了一些用户代理样式.我甚至无法取消选中属性值,例如.div{display: block},在DevTools的样式部分下面user agent stylesheet,就像我可以与其余的样式.
我该如何解决?或者更好的我如何删除用户代理样式?