symfony1

Uploaded docx files turning into zip

最后都变了- 提交于 2019-12-30 03:30:07
问题 I am currently using symfony 1.4 and would like to allow users to upload Microsoft Word docx files. Using the sfWidgetFormInputFile widget and sfValidatorFile below users are able to select and successfully upload their docx files using a simple web form. $this->widgetSchema['file_name'] = new sfWidgetFormInputFile(array('label' => 'File')); $this->validatorSchema['file_name'] = new sfValidatorFile(array( 'required' => true, 'path' => sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR

symfony 1.4: How to pass exception message to error.html.php?

坚强是说给别人听的谎言 提交于 2019-12-30 02:33:05
问题 I tried using special variable $message described here http://www.symfony-project.org/cookbook/1_2/en/error_templates but it seems this variable isn't defined in symfony 1.4, at least it doesn't contain message passed to exception this way throw new sfException('some message') Do you know other way to pass this message to error.html.php ? 回答1: You'll need to do some custom error handling. We implemented a forward to a custom symfony action ourselves. Be cautious though, this action itself

Extra changeColumns in Doctrine generate-migrations-diff

旧街凉风 提交于 2019-12-29 08:01:28
问题 I'm generating migrations between different yaml schema files: i.e. running: symfony doctrine:generate-migrations-diff And the resulting migration file has a whole slew of changeColumn calls that weren't added in the last schema file change. For example, if you run generate-migrations-diff without changing your schema file whatsoever, you should get an empty up() function. However, the function that results for me has a changeColumn call for virtually every table in my database. Am i doing

Display output from a Symfony task on a template

巧了我就是萌 提交于 2019-12-25 16:44:05
问题 I am executing a task from an action in Symfony. I wish to capture the output from the task & display it to the (admin) user. Do I extract it from the dispatcher / log or somewhere else? 回答1: This might not be the answer you're looking for, however, in a task you can log to a seperate file like so (within the execute function in the task class): $fileLogger = new sfFileLogger($this->dispatcher, array('file' =>$this->configuration->getRootDir().'/log/foobar.log')); $this->dispatcher->connect(

Move Symfony framework out from my sandbox application

一个人想着一个人 提交于 2019-12-25 16:43:10
问题 I use Symfony Sandbox structure in my development. Now, thinking of future ugrades, I want to separate the Symfony application out from my application and put it in a separate folder. The only problem is that it seems my application and Symfony are hopelessly intermingled together. Anyone has any idea how to separate the Symfony engines out from my sandbox application? 回答1: After the proper installation of symfony you just have to change the path in config/ProjectConfiguration.class.php from

Two tables relation with sfDoctrineGuard user table (symfony)

时光毁灭记忆、已成空白 提交于 2019-12-25 09:41:08
问题 Hy, I have started in my web application a part who users needs to be autenticated to work with it. I have two tables related: Customer and Enterprise.... the first one are users who want to buy a product and the second one are "users" who want to sell products. What is better way to do that? Relation 1:1 with user_table? how can i differentiate wich one user type is? Because user types only can edit some information and enterprise have acces to another modules... Thanks a lot. 回答1: You could

How to handle huge select query with symfony and doctrine?

廉价感情. 提交于 2019-12-25 07:49:46
问题 For example, i have playlist of 5000-10000 videos, what is the best way to select and show those videos in list. Pager is not an option, I need to have all of them becouse sorting and other functionalities? I thinking about solution to load list while scrolling the playlist, but this make me another problem, if i dont have all videos loaded, i can not properly save playlist. All suggestions/proposals are welcome... 回答1: use a dynamic pagination i.e, dont bring every thing to the frontend,

Remove 'web' from Symfony 1.4 path on shared hosting?

可紊 提交于 2019-12-25 05:47:08
问题 I've found a lot of helpful information about installing Symfony 1.4 on a shared hosting plan, but I've run into a stumbling block that's confounded me all day. Going to http://www.alternium.net/jobeet/index.php returns a 404 instead of the file at http://www.alternium.net/jobeet/web/index.php. /jobeet/.htaccess: Options +FollowSymLinks +ExecCGI # Enable rewrite engine and route requests to framework RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/robots.txt RewriteRule ^(.*)$

doctrine subquery in select with join

前提是你 提交于 2019-12-25 05:15:17
问题 schema.yml: Membership: columns: id: { type: integer(4), notnull: true, unique: true, primary: true, autoincrement: true } organisation_id: { type: integer(4), notnull: true } membership_subcategory_id: { type: integer(4), notnull: true } start: { type: timestamp } end: { type: timestamp } amount: { type: decimal, size: 2 } amount_paid: { type: decimal, size: 2 } notes: { type: clob (16000000), notnull: false } payment_type: { type: string(20), notnull: true } order_id: { type: integer(4),

Change approot path of Windows Azure WebRole

南楼画角 提交于 2019-12-25 04:20:07
问题 How is it possible to change the default approot path? E.g. I want to run a PHP Framework whose web root is a sub folder: symfony |_ app |_ bin |_ src |_ web <- Web root |_ index.php The web root of the WebRole is there: WebRole <- Web root |_ bin |_ php |_ resources |_ WindowsAzureSDKForPHP |_ diagnostics.wadcfg |_ Global.asax |_ Web.config |_ index.php ServiceConfiguration.cscfg ServiceDefinition.csdef When bringing both togehter I get: WebRole |_ bin |_ php |_ resources |_