symfony

Symfony Form Framework - Best way to implement change password functionality?

Hi, I'm trying to get my head around the form framework in Symfony 1.4. I've read the incredibly detailed section in the 'More with symfony' book, but I'm still a but unsure how to implement a simple 'Change password' functionality. The requirements are pretty basic, There'll be two fields, new_password, and confirm_new_password. Bot...

How to optimize image processing in Symfony from model

Hello, guys! Assume a Doctrine model Profile: # This is example of my schema.yml Profile: columns: avatar: type: string(255) notnull: true My goal is to generate profile's avatar from uploaded file: class Avatar extends BaseAvatar{ public function postSave($e){ if($this->getAvatar()){ // resize/crop it to 1...

Javascript source in partial view of symfony

Hi everybody. I'm using symfony 1.4, I wrote a piece of js code to use in a template, and I want to put it in a JS separated file because I'll use it many times in the code. I added the JS to the template using: <?php use_javascript('mi_js') ?> This templates has some ajax calls that refresh zones of the view with renderPartial meth...

Symfony Propel Pager - what is the proper way to send it a custom MySQL query?

Here is the query I need to run SELECT REPLACE(REPLACE(SUBSTRING_INDEX(LOWER(table.url), '/', 3), 'www.', ''), 'http://', '') AS domain FROM table GROUP BY domain But I'm having trouble passing a query like this to the Propel pager as criteria. I was hoping this would work. $criteria->addSelectColumn('SUBSTRING_INDEX(' . Table...

What's the best way to pass a variable to layout.php in Symfony?

All pages of the website I'm working on will show a signin form. I'd like to display this form in layout.php so it appears everywhere. I'm not sure what's the best way to do this. Should I use a filter? I don't think using a slot is efficient since content won't change throughout the site. ...

Symfony - Is it possible to disable output escaping per module (or per template)?

I'm trying to output some HTML in an XML template and Symfony's escaping method is messing it up. So I tried making a copy of settings.yml in the module's config folder, but it seems to be completely ignored. Is there an easy way to change the escaping_strategy and/or escaping_method settings per module or even per tample? ...

Two tables relation with sfDoctrineGuard user table (symfony)

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 dif...

Unable to send mail in Symfony 1.31

I am trying to send email using the following method in my action class: public function executeTestnewmail() { // send an email to the affiliate $message = $this->getMailer()->compose( array('my_email_address_here' => 'Jobeet Bot'), 'recipient_address_here', 'Jobeet affiliate token', <<<EOF Your Jobe...

symfony error 500 instead 404 at production

Hello, my symfony project at production when an actions does not exist is throwing error 500 instead of 404. At dev enviroment, it shows error 404 (actually a debug of the 404 error says action not found). I am using custom 404 templates as manual says. ...

Can I use Facebook's hiphop with frameworks like Zend Framework, cakephp, symphony

Yesterday Facebook launched HipHop, a sourcecode-converter from php to c++. The set of php functions and constructions is more limited that standard php. Are the current popular php frameworks (ZF, CakePHP, symphony) compatible with HipHop? If not, which parts of this frameworks are not usable? ...

Automatically getting a query instead of a result set in Symfony

In my schema, a user is related to their questions. I want to display all questions asked by a user. I also want this page to be paginated using sfDoctrinePager which requires a Doctrine_Query as a parameter. I know I can call $my_user->getQuestions() to get all questions from my_user, but is there a way to get the query to get all th...

MySQL database collation and character set.

I have a mySQL database that has collation and character sets as follows: mysql> show variables like "character_set_database"; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | character_set_database | utf8 | +------------------------+-------+ 1 row in set (0.00 sec) mysql> show...

Symfony sfGuardPlugin (group, permissions and credentials) question

I am using symfony 1.31 with propel ORM and sfGuardPlugin I am about to setup groups and permissions. AFAIK, permissions map unto Credentials, and permissions can be assigned to groups. I have two questions Suppose a user belongs to group A, and group A has credentials 'foobar'. When a user that belongs to group A logs in, does he 'a...

Symfony (doctrine): "Embedding" foreing forms

Hi folks, I always have this kind problem with Symfony : Let's say you have a product, and you want to add it some photos. I guess like this there's no problem : Product: columns: name: { type: string(255), notnull: true, unique: true } Photo: columns: product_id: { type: integer, notnull: true } name: { type:...

Symfony Propel Project: How to upgrade schema without database resets ?

I've deployed my symfony project to the server and now I wanna change the models inside schema.yml without reseting other unrelated database tables and keep the current data. Is there any diff / upgrade feature for symfony propel project ? ...

CSRF attack detected when submitting data using ajax

Hi, I'm trying to submit a form using jquery in symfony 1.4, but CSRF attack detected error pops up each time. This is the code i use to submit the form data: $.ajax({ type: 'post', cache: false, url: $('#assign-form form').attr('action'), data: ( 'activity[id]=' + $('#activity_id').val() + '&act...

Symfony route url (variable joined to a literal)

I'd like to generate an URL like this one: /MyCategory/MySubCategory/page2.html I have tried to do it this way: my_route: url: /:variable1/:variable2/literal:variable3.html But Symfony outputs this: /MyCategory/MySubCategory/page:variable3.html I'm using Symfony 1.4.1 How could I solve this? ...

How do I map different server names to differrent DirectoryIndex in PHP Symfony?

Symfony uses the following typical .htaccess file: Options +FollowSymLinks +ExecCGI <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] </IfModule> and I have this as my vhost: <VirtualHost 1...

How to set default value to a extra field in a symfony form

What i need to do is customize my default userForm by adding a 'passwordagain' field and set the value to the new field equal to the 'password' field. My code: class UserForm extends BaseUserForm { public function configure() { $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->widgetSchema['passwordagain'] = n...

recommended production environment for php5 application on windows?

We are about to deploy a php5 / symfony / mysql application on a windows stack (windows 2003 server) Our IT department doesn't have much experience administering any other stuff but microsoft technology, so I'd like to know what configuration would you propose for a production environment... apache and php on windows? php on iis? etc...