symfony1

Rewriting Not In Sub-Select as Join for Propel

故事扮演 提交于 2019-12-02 07:40:56
问题 Given the following schema: person: id: ~ group: id: ~ group_membership: person_id: ~ group_id: ~ I am attempting to find members not within a certain group using Propel's Criteria, which the following SQL will do: SELECT * FROM person WHERE id NOT IN ( SELECT person_id FROM group_membership WHERE group_id = 1 ); Unfortunately, Propel doesn't support sub-selects. It's possible to perform the sub-select first and pass it directly as an array, but I would rather do it in one call. I found this

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

Different databases for specific branches of git project

最后都变了- 提交于 2019-12-02 04:54:16
We have several branches of one project that share about half of the code and develop them simultaneously with git checkout. Now, the problem came when the model became so different, that it is no longer possible to keep the same database for their development. I could have specified the database name in the config/databases.yml specifically for each branch, but it is not tracked. Another solution would be to track some external file with branch name, for example, config/branch.txt, and reference it in config/databases.yml: all: doctrine: class: sfDoctrineDatabase param: dsn: 'pgsql:host

Rewriting Not In Sub-Select as Join for Propel

两盒软妹~` 提交于 2019-12-02 04:22:23
Given the following schema: person: id: ~ group: id: ~ group_membership: person_id: ~ group_id: ~ I am attempting to find members not within a certain group using Propel's Criteria, which the following SQL will do: SELECT * FROM person WHERE id NOT IN ( SELECT person_id FROM group_membership WHERE group_id = 1 ); Unfortunately, Propel doesn't support sub-selects. It's possible to perform the sub-select first and pass it directly as an array, but I would rather do it in one call. I found this article , which suggests using a custom criteria or converting it to a join. Is it possible to convert

How to document a Symfony based REST API (similar to enunciate's documentation capabilities)

纵饮孤独 提交于 2019-12-02 01:46:07
If I have a REST based service written in the Symfony [symfony-project.org] framework (i.e. PHP), is there any decent tools/frameworks out there that will parse my code and generate API documentation? The Java based framework enunciate has documentation capabilities similar to what I need, you can view an example of this here: http://enunciate.codehaus.org/wannabecool/step1/index.html . I understand the premise of REST based services are supposed to be self evident, however I was after something that would generate this documentation for me without the need to manually write up all my

How to catch an id from sfUser?

孤街醉人 提交于 2019-12-02 01:37:51
I'm working with symfony 1.4 & i use sfDoctrineGuardPlugin as a tool for authentifications. I want to catch the Id of user in order te store it in my table. After a small research, I guess I have to use that expression : getUser()->getGuardUser()->getId() . What i looking for is how to invest that expression for my target. Tom if the user is authenticated, yes, you can use: // inside an action $id = $this->getUser()->getGuardUser()->getId(); // inside a template $id = $sf_user->getGuardUser()->getId(); If the user is not authenticated, it'll throw an error. Depends from where you are calling.

Validate a field depending on another field value in Symfony

喜夏-厌秋 提交于 2019-12-01 23:37:19
问题 I have two related fields in a Symfony form: object_status and cryopreservation_method . The first one cannot be null and stores one of three possible choices: liquid , solid or cryopreserved . The second one should be only set if a record has its object_status set to 'cryopreserved' . Otherwise it is NULL . How can I check this in the server side (not with Javascript) before saving the form? I have tried to check for null or empty values in model, but with no luck. 回答1: You have to create a