symfony1

symfony doctrine admin generator -> custom listing

强颜欢笑 提交于 2019-12-11 10:32:26
问题 I haven't found a way yet to customize what items are shown in the "list" view. To be a little bit more specific : by default all the records in a database table are selected and displayed, I want to be able to tweak a little the database select in order to select only a subset of items from the table. 回答1: config: list: table_method: getForAdminList Then, in a related model table class you can define your conditions to filter records: public function getForAdminList() { $q = $this-

Join queries in Doctrine on tables without specified relations

跟風遠走 提交于 2019-12-11 10:27:12
问题 I have two tables that do not have a relation defined with each other in the schema.yml. However, table 1 has a foreign key reference to the primary key of table 2. Clearly, I goofed up by not designing the database well, but now it's mitigation time. I must do a left join between the two tables coupled with a where clause that will retrieve the select rows I want. And to do this, I do: Doctrine_Query::create()->select('t.*, l.lid')->from('Taxonomy t')->leftJoin('t.Cid c') ->leftJoin('c

symfony doctrine query result and execute function

℡╲_俬逩灬. 提交于 2019-12-11 10:16:34
问题 I have this doctrine query in symfony. It returns a lot of rows when i run mysql code generated by this dql query in phpBB but when i run it in symfony and access its results with this code: foreach ($this->courses as $course){ echo "<br>".$course->firstname;} it returns only one name. Also when i try to get $course->title , this error appears Unknown record property / related component "title" on "Students" Query: $q= Doctrine_Query::create() ->select('s.firstname, s.middlename, s.lastname,

Embed forms in Symfony

霸气de小男生 提交于 2019-12-11 08:53:53
问题 I've added a profile class to sfDoctrineGuard, and in the admin I'm trying to edit the profile part while editing the user, using embed forms as explained here: http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin Editing users works, but when I add "User": [username, password, password_again, Profile ] All I get is an error message : Widget "Profile" does not exist. Any help would be appreciated. Is the blog post out of date ? 回答1: There's a nice

Issue with symfony 1.49 and MySQL 5.5.8

落花浮王杯 提交于 2019-12-11 07:06:19
问题 when I go to generate the model with symfony propel:build-sql symfony generate a file where after each create sentece adds "Type=InnoDB". But when I go to insert the tables in the db with symfony propel:insert-sql I've got an error, so I have to change manually "Type=InnoDB" by "Engine=InnoDB" So, the question: Is there a way to symfony do this change automatically? 回答1: Check out this question, seems like it has a solution for you — symfony 1.4 propel:build-all not working on Mysql 5.5 来源:

How to update 2 tables from one form in Symfony?

拥有回忆 提交于 2019-12-11 06:43:58
问题 I have a have a form that I have added an extra sfWidgetFormTextarea widget onto in the form class. I want to save the form by updating database for the fields that correpsond to the form, but then get the value for the sfWidgetFormTextarea and insert that into another table as a new row saving both the textarea value and the id number created for the saved data in the other table. It sounds confusing so maybe if I put it in context it'll be less so. My form is getting the details of a

php related error in linux terminal while setting up symfony framework

戏子无情 提交于 2019-12-11 06:26:20
问题 i am trying to setup a new symfony framework project on ubuntu by following the documentation. But all the commands mentioned in the docs starting with 'php' give out the following error. The program 'php' is currently not installed. You can install it by typing: sudo apt-get install php5-cli bash: php: command not found. But php is installed and running on the system! How do i get past this error ? Thanks in advance. 回答1: There are several different PHP packages; probably the one that is

retaining POST parameters after login page in symfony

左心房为你撑大大i 提交于 2019-12-11 06:12:55
问题 how can i make symfony retain the POST data after login page? for example, the cookie was expired while user was filling the form. after submitting the form user gets a redirect to a login page. and after successful login he gets a redirect back to form's "action" url without any POST data from the initial form. is there any mechanism in symfony to handle that data, or i have to write my own? btw, i'm using sfGuardPlugin 回答1: I wrote a simple filter for that. Maybe you can extend its features

How to configure symfony project in local server?

岁酱吖の 提交于 2019-12-11 06:10:07
问题 I am beginner for symfony. I have to configure the already developed project that is built using symfony. I changed the database information but when browse localhost/myproject/web there is nothing displayed. What can i do to configure the project in local server. I have created the database as well. Hope to get help. Thanks .......... 回答1: you need to point apache to the web folder in your symfony project. or if your project reside inside apache web root you could use: http://localhost

How to add a new form to the Jobeet example?

纵饮孤独 提交于 2019-12-11 06:09:00
问题 I did the Symfony 1.4 Jobeet example project and now i would like add an additional form. How to do it correctly in a single project? Default Symfony itself generates the first form, but how can I create my own from scratch? If i use in command line: php symfony doctrine:build --forms This generates only the default form, I would like to have two forms. How can I do it? Must I generate a new project? 回答1: No, you do not need to create a new project. You can extend your test project by adding