Most voted "symfony-2" questions
Symfony 2 is a web framework written in PHP that follows the MVC (model-view-controller) paradigm. Available under the MIT License, differs from Version 1 basically in directory structure, configuration form
Learn more…80 questions
Sort by count of
-
13
votes1
answer1308
viewsWhat are the design standards for Serviceprovider and Servicecontainer used in Laravel and Symfony?
In frameworks Laravel 4 ou 5 and Symfony, I realize that there are two classes that are essential for the operation of the whole system: Servicecontainer and Serviceprovider. It seems to be a way…
-
6
votes1
answer1324
viewsHow to authenticate the application and authorize it to consume a restful API
In a given project, it was necessary to create a restful API that receives data from various forms spread across multiple sites hosted on different servers. The API was created to solve the…
-
4
votes1
answer82
views"Unexpected tag name" syntax error in Symfony2/Twig
My list has the code below: <h1>Posts</h1> {% for posts in post %} <article> <h2> {% post.titulo %} </h2> <div class="content"> {% post.conteudo %} </div>…
-
4
votes1
answer1467
viewsHow to avoid misuse of a REST API?
I am developing an application that is composed of three parts: Backend (BD + API), developed with Symfony 2 + Doctrine 2 IOS client Android client Most client requests for the API must be…
-
4
votes1
answer460
viewsRelationship between 3 entities
I have the following tables: +----------+ +----------------------+ +------------+ | Produtos | | ProdutosVsCategorias | | Categorias | +----------+ +----------------------+ +------------+ - ID - ID…
-
3
votes2
answers74
viewsUnrecognised function
Hello I have the following code: Old code: public function historicoAction() { $entity = new Intervencao(); $em = $this->getDoctrine()->getManager(); $entities =…
-
3
votes1
answer654
viewsAccess-Control-Allow-Origin: * does not work for all my domains
I have four applications that use the same API, and the Access-Control-Allow-Origin: * not all of them, the only application that doesn’t work is the one that I’m using Zend Framework 2 and Symfony,…
-
3
votes1
answer223
viewsWhat is the overhead when using Doctrine?
A few days ago I was discussing with some colleagues about performance and high availability. In the middle of the discussion one of the points raised was that when reaching a certain number of…
-
2
votes1
answer539
viewsHow to upload using php without forms
I need to upload a file from the local server to another server. In this environment I compact the file on the local server and send the compressed file to the remote server. The remote server will…
-
2
votes1
answer159
viewsHow to import CSV into Symfony2
I am trying to create a generic way to import CSV the $data represents a full line of csv data. I am trying to generate a answer to register the data using the form public function…
-
2
votes1
answer175
viewsError while uploading site
Guys I just uploaded a site of mine made in Laravel 5.2 with Pho 5.6 locally. I went up to a shared hosting in Locaweb that I have. I configured PHP 5.6 correctly and I went up the site here giving…
-
2
votes1
answer65
viewsWhat might be causing double requests to PHP?
I am developing a system in Symfony2 and during the homologation process the client caught an error in which the system alerts keep repeating themselves. The code used is this: $objManager =…
-
2
votes1
answer45
viewsHow to use Paramconverter inside the controller or in service
The Paramconverter is a note that I use constantly in Symfony to recover the data sent already in object, so parse is made automatic, in my case, simply add comment in the method of the respective…
-
2
votes1
answer58
viewsWhy do we use the Containerinterface when injecting @service_container as argument?
In the archive services.yml I have the following service configured: services: api.response_factory: class: AppBundle\Api\ResponseFactory arguments: ['@service_container'] In class ResponseFactory I…
-
2
votes1
answer201
viewsHow to build a reusable and manageable symfony Bundle via Composer
Even after reading the best practices for code reuse in symfony and research on the use of commiserate, I still can’t understand how in practice I should create my Barcode to be reusable. I know the…
-
2
votes1
answer436
viewsSymfony Single id is not allowed on Composite Primary key in Entity
I have a view, where Mapeei 3 fields as primary key and 2 of these fields are foreign keys As below: /** * @var NotaFiscal * @ORM\Id * @ORM\ManyToOne(targetEntity="NotaFiscal", inversedBy="itens") *…
-
1
votes1
answer108
viewsBlameable behavior does not work on Symfony2
I am implementing in Symfony2 the behavior Blameable using the Gedmo\Mapping\Annotation. I have successfully implemented the Timestampable, but I cannot implement the Blameable. The problem is that…
-
1
votes1
answer112
viewsSymfony2/Doctrine - Query Join with three different entities
The way below works correctly: $qb->select('partial t.{id,nsu,status,message}, partial u.{id,shortName,email} as user') ->from('GatewayBundle:Transaction', 't') ->join('GatewayBundle:User',…
-
1
votes1
answer42
viewsConversion of parameters with Symfony2
Does anyone know any elegant way to convert a parameter to symfony2 Paramconverter Symfony2 but I don’t use Annotations. Some alternative ?…
-
1
votes1
answer834
viewsHow to customize Symfony CRUD generated form?
I’m changing the Symfony template so that CRUD already has the format I need, I was able to change almost everything, but now I had the need to change the form, to edit the css classes and other…
-
1
votes2
answers198
viewsSemantical Error - Doctrine createQueryBuilder
But once I get caught using Doctrine. I wanted to do it: SELECT c.nm_computador, c.te_ip_computador, log.usuario, log.data FROM computador c INNER JOIN log_user_logado log ON c.id_computador =…
-
1
votes1
answer81
viewsSend data from one table to another
And the next thing I know, I have an Entity called the Post where there’s a record of a post and I have an Entity called the Machine. The goal is: Having a table like this where we create a machine…
-
1
votes2
answers66
viewsSymfony 2 create query
createQuery("select p.name from blogBundle:Person p where p.id not in(select c.person from blogBundle:Category c)")->execute(); And I’m getting this mistake: Error: Invalid PathExpression. Must…
-
1
votes1
answer55
viewsMenu control
I have a menu in a Bundle and have want to add to that menu a part that is in another menu, but I want those menus to appear both on all pages. The main menu is this: {#…
-
1
votes1
answer34
viewsHow to Lock Project Version on Symfony
I have a version 2.6 on symfony and would like to lock my project in it so as not to risk an update and start giving bugs. Someone knows the command to do this?
symfony-2asked 8 years, 10 months ago Marcius Leandro 462 -
1
votes2
answers82
viewsSymfony - Working with images?
I need to create an image with php , I would like to know if Simfony has a library or something already included in it to work with GD/Imagemagick functions. I’ve been researching and I’ve seen…
-
1
votes0
answers17
viewsLog with CPF in Fosuserbundle
Fosuserbundle by default connects with email or username and password. But I want to change to CPF and password. I created Cpfprovider, I wrote some classes, but I’m having to practically overwrite…
symfony-2asked 7 years, 10 months ago Bruno Roboredo 11 -
1
votes1
answer96
viewsSymfony2 - Updating an entity’s field when executing action in another entity’s Controller
I need to update the field budget of my entity Client when inserting new data into the table Budget. Both have relationship oneToMany and manyToOne, respectively. I received suggestions to use the…
-
1
votes0
answers42
viewsProblems with listing an entity as a checkbox in Symfony2
My system has two related tables called material and items_budget. The second table has a form that lists the name of each material in a checkbox, followed by two more input, one for your quantity…
-
1
votes0
answers57
viewsSymfony2 - Only one field has its value read, the others of this same field are NULL when submitting form
I have two related tables: material and items_budget. The table items_budget has a form that has a field that lists the name of all material in a group of checkbox, and next to each checkbox has two…
-
1
votes2
answers70
viewsHow Symfony 2 manages route conflicts with the same name
I am using Annotations in the project. In the archive routing.yml I have the following configuration: acme_store: resource: "@AcmeStoreBundle/Controller/" type: annotation prefix: /acme teste_blog:…
symfony-2asked 8 years, 8 months ago Filipe Moraes 8,737 -
1
votes1
answer290
viewsUse like in the findby method to filter records?
I have the following code in my controller: $shares = $this ->getDoctrine() ->getRepository('AppBundle:Shares') ->findBy( $where, $orderBy, $paginator->getPerPage(),…
-
1
votes0
answers6
viewsDoubt of Symfony2.16
I am working with symfony2.16 I intend to select the person if this is not a foreign key in the user table my code is like this: public Function buildForm(Formbuilderinterface $Builder, array…
symfony-2asked 7 years, 4 months ago Osvaldo Avelino 11 -
1
votes0
answers23
viewsHow to set cookie information within a Symfony2 controller
I need to set some information in the cookie when a new user creates their registration in the system. The registration screen is this: I have the following controller: <?php /** * Exibe o…
symfony-2asked 7 years ago Felipe Araujo 21 -
0
votes1
answer473
viewsRelationship in the Doctrine
I have a problem that is analogous to the following situation: A car may or may not have a driver, or a car may have at least 0 and at most 1 driver. A driver may or may not have a car, ie a driver…
-
0
votes1
answer201
viewsHow to work with I18N in PHP and Symfony?
There is an add-on to Symfony that allows you to work with i18n and . po and . mo or similar or is it really necessary to implement a solution for this? Ideally I could call the translation both on…
-
0
votes2
answers890
viewsDirect upload to Amazon S3
I work using Symfony 2.5, Heroku and Amazon S3 hosting for the static files. I am working on a project where the user can upload very large images, and this ends up locking the server of my app or…
-
0
votes1
answer583
viewsDoctrine Date Format
I would like to format a date with Doctrine, often I save a date like datetime in the database but want to perform a search grouping per day without considering minutes and seconds. Does anyone know…
-
0
votes1
answer147
viewsHow to retrieve the contents of a rendered template in Symfony2 and store in a String
I’m using the Symfony2, I’m still getting familiar with this framework. And when using my controller I’m not sure how to pick up the output generated by it and play for a string. I need to play for…
-
0
votes1
answer536
viewsPick up form value
This is my Twig form. <form id="csv" action="{{ path('faturamento_csv') }}" method="post"> {% for elm, value in filtroLocais %} <input type="hidden" name="{{ elm }}" value="{{ value }}">…
-
0
votes1
answer196
viewsHeroku task scheduler to run PHP script
I need to run a PHP script in Heroku with the task scheduler, I’m reading this article but I don’t understand. Some idea?…
-
0
votes1
answer624
viewsGet values from $request
I would like to take all the values of a certain key of a request. Ex Request:…
-
0
votes3
answers212
viewsError at end of Symfony installation
I’m willing to learn Symfony and then did the installation as they speak on the site: composer create-project symfony/framework-standard-edition meuprojeto/ '~2.5' Until then did the installation,…
-
0
votes0
answers70
viewsRelationship between the two
Here’s the thing, I’ve got an Entity Machine and another Predicted Entity, and they’re both in the same Bundle. What I intended was that in machine 3, which has already been created, every 100…
-
0
votes1
answer498
viewsSort by date
Look it is possible to sort a table by date in javascript, symfony2 or jquery? I have a table with various data and records and I would like to sort the records by date.
-
0
votes1
answer41
viewsEntity Repository
I have the tables: Operário(id,identidade(string)); Intervenção (data(date), hora(time), duracao(integer)); Avaria (data(date), descricao(string), impedimento(boolean)); Prevista (contagem(integer),…
-
0
votes2
answers98
viewsComparison of dates
I want the message to appear when the user enters no date or the initial date is longer than the final date. The code I made was this: /** * @Assert\True(message = "Erro! Verifique as horas. Data…
-
0
votes1
answer194
viewsImplement __toString() method
I have a foresight printer and when I step in the path of foresight.new give me error. A "__toString()" method was not found on the Objects of type "Roqsys Control Manutencaobundle Entity Maquina"…
-
0
votes1
answer96
viewsHow to run methods of all classes extending an interface on symfony
I needed something similar to that console doctrine:fixtures:load in relation to class DataFixtureLoader and the interface OrderedFixtureInterface that is, I want to make a Command where it searches…
-
0
votes1
answer767
viewsfindBy() all records with two conditions
I’m trying to work with findBy() in an application made in Symfony2. I would like to put two conditions on Findby or mix with Where if possible, but am not getting. $properties =…