symfony-1.4

How to create a custom yaml config file in Symfony

守給你的承諾、 提交于 2019-12-02 20:37:36
What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directory and added the following at the top of the file: config/something.yml: class: sfDefineEnvironmentConfigHandler param: prefix: something_ But if I'm calling sfConfig::get("something_foo"); I keep getting NULL . What did I do wrong? I just want to read values, so no need to

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 - Form requested url not found

╄→гoц情女王★ 提交于 2019-12-02 12:36:22
问题 Im working on a symfony project. Im battleling with a form that won't redirect to its own page. The action attribute is set to "" and method set to post. In that case it should call the same page but I'm ending on a 404 page. Here's the code of my page in the action file: public function executeDetail(sfWebRequest $request) { if($request->isMethod(sfRequest::POST)) { if(!$this->getUser()->isAuthenticated()) $this->redirect('@user_login'); $formData = $request->getParameter($this->form-

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 memory issues

烈酒焚心 提交于 2019-12-02 09:49:22
I'm having hard time with symfony and cpu/memory leak, i'm new to symfony i don't know if i'm messing any tips or techniques to overcome this problem. i'm hosting my current symfony project on a vps and it halts almost every other hour. I would like also to know the answers for these questions : when i execute a doctrine query using (fetchOne, fetchAll, execute) i get a lot of extra symfony stuff like table name and structure ... is there any way to get just the data ? what should i do to optimize my symfony app Thanks glerendegui Your problem looks very abstract. It's very hard to help you

symfony - admin module filters accessible as links

妖精的绣舞 提交于 2019-12-02 07:29:00
I am working on an admin dashboard, which will be mainly based on the current user that is logged in usingsfDoctrineGuardPlugin What I'm looking to do though, is to have links in the dashboard, that are basically filters to other modules. The problem is, I'm not sure how I'd do that. For example, I'd like to have the following as links: List New Users - This link needs to list all users added in the last 30 days List Suppliers - This needs to list all users that are a group with a group_id of 2 List Manufactureres - This needs to list all users that are in a group with group_id of 3 How would

$sf_response->addStyleSheet() dosen't work in SF 1.4?

独自空忆成欢 提交于 2019-12-02 07:27:15
Does anyone know how to add stylesheets in a template with Symfony 1.4 ? I have tried everything I can think of, from modifying frontend/config/view.yml to modifying the template itself - bothing works. I have seen from my searches, that other people have had the same problem. There seems to be a clash of sorts between using include_stylesheets and use_stylesheets - however this is not documented anywhere AFAIK. Edit: Ok I think I got it now. You should add include_stylesheets() into the head section of your layout file: <html> <head> <title>This is the title</title> <?php include_stylesheets(

symfony - admin module filters accessible as links

随声附和 提交于 2019-12-02 07:01:59
问题 I am working on an admin dashboard, which will be mainly based on the current user that is logged in usingsfDoctrineGuardPlugin What I'm looking to do though, is to have links in the dashboard, that are basically filters to other modules. The problem is, I'm not sure how I'd do that. For example, I'd like to have the following as links: List New Users - This link needs to list all users added in the last 30 days List Suppliers - This needs to list all users that are a group with a group_id of

500 internal server Symfony on production, possibly due to PHPsuexec

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 06:29:40
Running into a 500 internal server error on my subdomain installation of Symfony when I attempt to visit any modules. The server does have PHPsuexec installed on it. Does anybody know whats up? Otherwise it states that the symfony project is installed and it runs fine on my server. One glitch could be that on my server the directories have permissions 777 and all files have 666 permissions. However, courtesy of PHPsuexec, most my directories seem to have 775 and the files a 664 permission level. Thanks all! Parijat My guesses would be: Check if you have enabled mod_rewrite and your htaccess

How to retrieve all records after one with an ID in symfony?

别说谁变了你拦得住时间么 提交于 2019-12-02 04:27:41
Let's say I have a table that I sort alphabetically in symfony. Each item has a rather random id and I'd like to retrieve all items after a certain ID. For example: Name ID ------------ Apple 5 Banana 9 Coconut 3 Date 1 Eggplant 8 Let's say I wanted to retrieve Date and Eggplant . I know beforehand of the ID 3 and that I want everything after it. How should I construct the statements to achieve this? I don't care if the answer uses Propel, MySQL, SQL, or whatever. As long as it's possible. SELECT * FROM tbl1 WHERE name > ( SELECT name FROM tbl1 WHERE id = 3 ) ORDER BY name (runs at least with