symfony1

sfValidatorDoctrineUnique fails on capital letters

百般思念 提交于 2019-12-25 03:59:14
问题 I've setup a post validator in my symfony form to stop duplication of primary keys. A primary key is a two-character string in this instance. Code used to validate: $this->mergePostValidator(new sfValidatorDoctrineUnique(array( 'model' => 'Manufacturers', 'column' => 'id', 'primary_key' => 'id' ))); The primary key is uppercase (for example AU). Bizarrely the post validator triggers successfully is lowercase 'au' is entered into the field (i.e. stops it from going to the database and

Symfony: why is my main page example.com/web instead of example.com (as it should be?)

左心房为你撑大大i 提交于 2019-12-25 03:55:38
问题 My directory tree looks something like this: public_html example.com(containing symfony files) lib web app etc... example.net example1.com example1.net When I access my site via example.com it just shows my directory tree under the folder example.com, instead of routing to my actual homepage. How do I fix this? 回答1: You should place all files (except the web directory) in the directory directly above the web directory. Then create a symlink public_html to your web directory, or add the files

symfony on virtual host document root problem

a 夏天 提交于 2019-12-25 03:41:09
问题 Im trying to deploy symfony on virtual host. mod_rewrite converts /web URLs to domain root URLs (domain.com/image.gif is turning internaly into domain.com/web/image.gif). But thanks to web is executed internaly from /web dir, Symfony is still thinking it has document root there and prefixes any url_for() URLs with /web. So when i have route: show_books: url: /books ..and iam asking for: url_for('@route_name') Symfony is generating: /web/books I cant change hosting behaviour, i need to have

Symfony output image “”“Cannot modify header information - headers already sent by…”“” [duplicate]

别等时光非礼了梦想. 提交于 2019-12-25 03:34:46
问题 This question already has answers here : How to fix “Headers already sent” error in PHP (11 answers) Closed 6 years ago . in /lib/Helper.class.php: class Helper { //... some functions static public function createImage( $src_image, $params) { $vars=array(); foreach(array('angle'=>0,'font'=>'dejavu','font_size'=>20,'line_spacing'=>1.5,'preset'=>'BRCA','color'=>array(0,0,0),'text'=>'default text') as $key=>$value): $vars[$key]= array_key_exists($key, $params)?$params[$key]:sfConfig::get('app

get all groups from the Users - sfDoctrineGuardPlugin

喜欢而已 提交于 2019-12-25 02:15:49
问题 In sfDoctrineGuardPlugin is: sfGuardUser: actAs: [Timestampable] columns: first_name: string(255) last_name: string(255) // indexes: is_active_idx: fields: [is_active] relations: Groups: class: sfGuardGroup local: user_id foreign: group_id refClass: sfGuardUserGroup foreignAlias: Users sfGuardGroup: actAs: [Timestampable] columns: name: type: string(255) unique: true description: string(1000) relations: Users: class: sfGuardUser refClass: sfGuardUserGroup local: group_id foreign: user_id

Symfony 1.4 Cross APplication link fail

回眸只為那壹抹淺笑 提交于 2019-12-25 01:12:27
问题 My Apps require cross application linking and after meticulously following the blog at http://symfony.com/blog/cross-application-links I got one of them working and one of them not working. The link to the backend application from the frontend works fine but not the link to the frontend on the backend code? Basically I have on my backendConfiguration.class.php file : protected $frontendRouting = null ; public function generateFrontendUrl($name, $parameters = array()) { return 'http:/

Symfony 1.4 makes 15 DB requests for 1 query [duplicate]

青春壹個敷衍的年華 提交于 2019-12-24 23:51:55
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: got a select that does 10 query in doctrine (Symfony) I currently have a big problem with my symfony app, I have a complexe sql query that makes too much connections the the database. The query order, search for keyword using doctrine searchable, and check the geo position. Here the complete model pasted and the sql log, anyone got an idea what I am doing wrong ? :/ public function getListItems($orderby, $budget

Symfony Doctrine skeleton files

*爱你&永不变心* 提交于 2019-12-24 21:57:46
问题 I'm using Symfony 1.4 with the Doctrine 1.2 plugin. I would like to add some function to the Doctrine auto-generated models files (*Base.class.php). Thoses file are normally generated using "./symfony doctrine:build-model" command from the CLI. I know Symfony have a system of skeleton for every file generated from the CLI but I habe absolutely no idea how to modify specific Doctrine skeletons files. I've looked a the documentation but didn't find any hints. Is this even possible ? 回答1:

Symfony: how would you reverse the “notnull:true” in a schema of a plugin?

℡╲_俬逩灬. 提交于 2019-12-24 21:26:11
问题 sfGuardUser model of sfDoctrineGuardPlugin is defined this way: sfGuardUser: actAs: [Timestampable] columns: id: type: integer(4) primary: true autoincrement: true username: type: string(128) notnull: true unique: true As you can see 'username' has the feature "notnull:true". Now i want to create a register form that is not using 'username' but the email address of the user. When a user wants to register, it is showed this: Validation failed in class sfGuardUser 1 field had validation error:

sfWidgetFormDoctrineChoice renders only one value but query returns 5 values

风流意气都作罢 提交于 2019-12-24 19:54:53
问题 I'm using a sfWidgetFormDoctrineChoice in a Symfony form in this way: $this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => true)); I tried also with: $this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => 'Seleccione un Emisor', 'expanded' => false, 'multiple' => false)); $this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor',