symfony1

Action and pass variable to all actions in symfony 1.4

十年热恋 提交于 2019-12-02 18:52:07
问题 I want to make some action (php script) before all actions in my frontend app and then pass a result from that script to actions in variable - so I can get variable value from all actions. Where should I declare sth like this? 回答1: If the filter solution dont feet your needs, you can also create a base action class with a preExecute function: // app/frontend/lib/baseActions.class.php class baseActions extends sfActions { public function preExecute() { $this->myVar = .... // define your vars..

Multiple primary keys with Doctrine 1 and Symfony 1?

白昼怎懂夜的黑 提交于 2019-12-02 17:43:37
问题 I already know that's not possible to work with multiple primary keys in Symfony 1 and Doctrine 1, but do you guys know any good workarounds? 回答1: Beside many-to-many relationships doctrine1 does not work good with a primary key over multiple colums. But if you want to use many-to-many relationships use it like this: BlogPost: columns: user_id: integer title: string(255) body: clob relations: User: local: user_id foreign: id type: one foreignType: one foreignAlias: BlogPosts Tags: class: Tag

Symfony Generator Forms, Doctrine, and M:N Relationships

旧城冷巷雨未停 提交于 2019-12-02 17:26:17
问题 I have a basic M:N setup with three tables: candidate, position, and candidate_position. Here's a screenshot of the ERD from MySQL Workbench Now, moving on from that let's talk about forms. In the default world of symfony generator, you'd have a separate CRUD interface for all three of these tables. However, I don't want to have a CRUD interface for candidate_position . What I want, is for the create and edit actions of the Candidate interface to contain a multi-choice field (select list,

Symfony plugin sfDoctrineActAsTaggablePlugin not working

情到浓时终转凉″ 提交于 2019-12-02 15:34:26
问题 I want to attribute some tags to some of the objects of my doctrine model. I found sfDoctrineActAsTaggablePlugin which seems to be precisely what I need. The problem is that when I want to save a Taggable object, I get this error: Unknown record property / related component "saved_tags" on "Mishidea" Mishidea is the name of the class/table that I want to be Taggable. Here is the related portion of my schema.yml file: Mishidea: connection: doctrine actAs: {Timestampable: ~ , Taggable: ~ }

symfony vs cakephp [closed]

大兔子大兔子 提交于 2019-12-02 14:11:56
What is conceptually the difference between symfony and cakephp? Just to balance out this thread, this is why I like symfony: uses PHP5 it runs some really big sites like Yahoo! Answers, delicious, and Daily Motion . good documentation. the jobeet tutorial on the website is awesome. walks you straight through all of the features, and after you are done you feel like you can build anything. is highly modular ; many of the symfony components work on their own. allows you to choose either Propel or Doctrine as your ORM. Doctrine is really great and easy to use. you can define your models with

got a select that does 10 query in doctrine (Symfony)

半世苍凉 提交于 2019-12-02 13:04:53
I got a big query that execute 11 query, I didnt know where the problem is, but found the problem was in a select a did for geo loc, anyone has an idea how to correct that? It happens only when i use this query SfDoctrinePaginate Investigating further $q->select("a.longitude") create as much queries.. The problem: $q->select("a.longitude, a.latitude, (3959 * acos(cos(radians('".$lat."')) * cos(radians(latitude)) * cos(radians(longitude) - radians('".$long."')) + sin(radians('".$lat."')) * sin(radians(latitude)))) AS distance"); the complete model: public function getListItems($orderby, $budget

Action and pass variable to all actions in symfony 1.4

老子叫甜甜 提交于 2019-12-02 11:37:02
I want to make some action (php script) before all actions in my frontend app and then pass a result from that script to actions in variable - so I can get variable value from all actions. Where should I declare sth like this? If the filter solution dont feet your needs, you can also create a base action class with a preExecute function: // app/frontend/lib/baseActions.class.php class baseActions extends sfActions { public function preExecute() { $this->myVar = .... // define your vars... } } Then your module actions class extends your baseActions class: // app/frontend/modules/myModule

htaccess for Symfony on Shared Hosting

不羁的心 提交于 2019-12-02 11:24:00
Im trying to setup a local environment that resembles shared hosting. I have copied the entire project into the htdocs directory, and thus the application does not start by default in the web directory. For this I found these 2 references: http://oldforum.symfony-project.org/index.php/m/98117/ http://www.teamlalala.com/blog/2010/05/02/how-to-handle-symfony-on-shared-hosting/ But I have 2 doubts: 1. The .htaccess mentioned in the posts is to be added inside the WEB folder, or in the ROOT folder 2. If added to the ROOT folder, should we remove the default .HTACCESS in WEB? thanks in advance You

Symfony Generator Forms, Doctrine, and M:N Relationships

不想你离开。 提交于 2019-12-02 09:59:14
I have a basic M:N setup with three tables: candidate, position, and candidate_position. Here's a screenshot of the ERD from MySQL Workbench Now, moving on from that let's talk about forms. In the default world of symfony generator, you'd have a separate CRUD interface for all three of these tables. However, I don't want to have a CRUD interface for candidate_position . What I want, is for the create and edit actions of the Candidate interface to contain a multi-choice field (select list, checkbox array, whatever) that would create the CandidatePosition records as part of the Candidate actions

Symfony plugin sfDoctrineActAsTaggablePlugin not working

强颜欢笑 提交于 2019-12-02 08:39:21
I want to attribute some tags to some of the objects of my doctrine model. I found sfDoctrineActAsTaggablePlugin which seems to be precisely what I need. The problem is that when I want to save a Taggable object, I get this error: Unknown record property / related component "saved_tags" on "Mishidea" Mishidea is the name of the class/table that I want to be Taggable. Here is the related portion of my schema.yml file: Mishidea: connection: doctrine actAs: {Timestampable: ~ , Taggable: ~ } tableName: mishidea columns: idea_id: type: integer(4) primary: true autoincrement: true idea_title: type: