symfony1

Problems with database relations with symfony framework - Cannot fetch TableMap for undefined table

老子叫甜甜 提交于 2019-12-13 03:00:56
问题 Currently developing an application using the newest version of symfony, obtained through PEAR. This is my exact schema configuration propel: user: id: name: { type: varchar(255), required: true } level: { type: integer, required: true, default: 1 } created_at: post: id: title: { type: varchar(255), required: true } post: { type: longvarchar, required: true } user_id: created_at: updated_at: comment: id: relation: integer comment: { type: varchar(300), required: true } nick: { type: varchar

Symfony sfDoctrinePager with multiple tables

瘦欲@ 提交于 2019-12-13 02:51:38
问题 I was wondering how to get this to run. In my application I have a Category table and Product table. I need to have a pager which combines both Categories and Products for display in one list (first categories then products). Is there a way to get this going ? I tried left joining in the pager's query, but doesn't seem to do the trick. 回答1: If you can write a doctrine query to return the complete list of what you want, then the pager will page it. Not sure without a schema how you might write

How to use a Component with Admin Generator?

試著忘記壹切 提交于 2019-12-13 02:26:18
问题 I know we can use components with the admin generator (thanks to ~ symbol). However, in the components.class.php, how to call the auto-generated class ? At this moment, I'm using this : require_once dirname(__FILE__).'/../lib/commissionGeneratorConfiguration.class.php'; require_once dirname(__FILE__).'/../lib/commissionGeneratorHelper.class.php'; class commissionComponents extends autoCommissionComponents { } But I obtain this error : Fatal error: Class 'autoCommissionComponents' not found in

Symfony sf_culture = 1 error

◇◆丶佛笑我妖孽 提交于 2019-12-13 02:25:48
问题 I'm getting a lot of errors because of sf_culture = 1 on the server. {sfConfigurationException} Unable to find a matching route to generate url for params "array ( 'action' => 'legend', 'module' => 'housing', 'sf_culture' =>'1',)" Locally this matches the default route: Match route "default" (/:sf_culture/:module/:action/*) for /de_DE/housing/legend with parameters array ( 'module' => 'housing', 'action' => 'legend', 'sf_format' => 'html', 'sf_culture' => 'de_DE',) wich looks like this

Avoiding Spam Filters for account confirmation emails

你。 提交于 2019-12-13 00:50:04
问题 I have an application built in PHP/Symfony. Part of it requires sending what is essentially an account verification email to users. Unfortunately, it seems that my email is triggering spam filters (gmail, hotmail, probably others) and not making it to the users inboxes. What strategies can I use to avoid being filtered? 回答1: Rather than sending mail from the server where your website runs, it's better to use trusted external mail server. You can do that with Swift_SmtpTransport. You can even

Input code in TinyMCE

这一生的挚爱 提交于 2019-12-13 00:12:42
问题 I'm using TinyMCE on my blog and it seems to be removing the code I'm trying to paste. I want to add this: <Files somefile.png> DefaultType application/x-httpd-php </Files> (it's a .htaccess directive) This gets saved ok (as < and > in the html), but when I reopen my form for editing, it gets transformed as : DefaultType application/x-httpd-php Edit : I'm using TinyMCE in a Symfony form, using sfFormExtraPlugin. Edit 2 : I tried verify_html: false .... now my code gets transformed as : <p>

Set the default timezone in symfony

不羁岁月 提交于 2019-12-12 22:16:04
问题 i want to know how can i set timezone for an entire project? i'm using symfony 1.4 with doctrine and i have a problem with datetime saving. whenever i save a record, it's time is not correct and i know that's because of timezone. i know i can use date_default_timezone_set() function to set default timezone, but i have to do it in every single action that i'm using date and it's not right. is there an easier way to do it? i think doctrine should have something to set it automatically but i don

Doctrine Searchable Behavior vs Zend Lucene in symfony

一个人想着一个人 提交于 2019-12-12 19:22:15
问题 I need to search for keywords in 2 table, simple thing I am undecided about using one or the other? any suggestion performance wise? Thanks! 回答1: As cuhuak mentioned, Lucene is a fulltext search. Since it is written in Java, you additionaly need a Java Server (Tomcat for example). If you don't want an additional server, the Zend Lucene implementation (as noted in the comments by Matt Gibson) may also be worth looking into. With an additional server and if you only have a small host, this MAY

Cannot redeclare class sfconfig

我们两清 提交于 2019-12-12 16:46:09
问题 I am running Symfony (1.2.9) with PHP Version 5.2.11 on Windows XP. I have APC installed (Version 3.0.19) I can run PHP script to prove that apc is working correctly (works). However, when I try to use APC calls in a symfony action, I get this error (in the apache error.log file): [apc-error] Cannot redeclare class sfconfig Which promptly crashes Apache. I tried using the Symfony sfAPCCache wrapper, and then directly calling the apc_* functions - the result is the same. Does anyone know why

How to get doctrine to generate sql with BIGINT type?

时光怂恿深爱的人放手 提交于 2019-12-12 13:58:11
问题 In my schema I have a number of field that need to be BIGINT. I use symfony's symfony doctrine:build-sql to generate my database. The fields always come out as type int. I have tried the following types in the schema: int {type: integer, notnull: true} {type: integer(5), notnull: true} {type: bigint, notnull: true} None of them seem to work (I always rebuild the model before building the SQL). What type should i put in the schema.yml? 回答1: With Symfony 2.x (e.g. Doctrine 2.4.1) and PHP