symfony

Ignore duplicates when using INSERT in a Database with Symfony and Doctrine

I have a table CREATE TABLE `sob_tags_articles` ( `tag_id` int(11) NOT NULL, `article_id` int(11) NOT NULL, `id` int(11) NOT NULL auto_increment, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=112 And triing to save an object with Doctrine: $sbTagsArticles = new SobTagsArticles(); $sbTagsArticles->article_id = $pubId; $sb...

How does symfony choose the very content type?

txt: text/plain js: [application/javascript, application/x-javascript, text/javascript] css: text/css json: [application/json, application/x-json] xml: [text/xml, application/xml, application/x-xml] rdf: application/rdf+xml atom: application/atom+xml It is used by the framework to automatically manage the Conte...

Symfony: Is it possible to put elements inside a link_to tag?

Hi, I'm using Symfony 1.4 and wondering whether it's possible to achieve the following: <a href="#"><span>Text</span></a> ... using Symfony's link_to helper? Of course, it's possible to do this: <a href="<?php echo url_for('#') ?>"><span>Text</span></a> But I'm wondering if there's a simpler way to do it, especially as combining...

Symfony Jobeet: Need to refactor index page DB queries

I use Symfony 1.4 with Doctrine, and I noticed that my project has similar issue with Jobeet project at index page (http://www.symfony-project.org/jobeet/1_4/Doctrine/en/06). The problem is on index page the system shows to user jobs per category and we have 1+2*N database queries, where N - categories count. This isn't very good, if ...

how to load different frontend modules templates in backend for cutomizing templates contents using symfony 1.4,doctrine

how to load different frontend modules templates in backend for cutomizing templates contents I have class module in frontend & also templates as well. I have also created a module in backend as emailcontent for accesing several modules templates to customize html. 1. How do i access/Load templates in backend module emailcontent ...

How to "order by" a sfWidgetFormDoctrineChoice in the Admin Generator

I'm using Symfony 1.4 and Doctrine. Let's say I have 2 classes : a Brand and a Product. When I create a new product in the Admin Generator based admin, I'd like to choose a brand from a dropdown list. The Admin Generator is doing that for me, automatically creating a sfWidgetFormDoctrineChoice. The problem is that the brands are order...

Why is my controller requesting frontend_dev.php in Symfony?

http://localhost/frontend_dev.php/1 Why is the above request redirected to frontend_dev.php instead of index.php? I've read the .htaccess: <IfModule mod_rewrite.c> RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something ...

How to pass a parameter from a form in Symfony and PHP?

I am trying to implement a very simple search function with PHP in symfony. Basically I have a form that posts a query and I want to retrieve the items in the database that match the query. If I have a User table with columns first_name and last_name, I want to be able to retrieve all items that contain a query. For example, if I submi...

setBaseQuery not working on Tasks in Symfony

Hi, I'm building a Task in Symfony with Doctrine. I'm getting all the places to make a batch update to a particular field. This has to be done in two languages. I'm using setBaseQuery() to make the JOIN on the query with the language I want. If I do the following in an action, it works without any problem. However, If I do it in a task...

Anyone successfully used php_apc with symfony1.4?

I can only make symfony work properly by diabling php_apc.dll,very strange! The PHP version is 5.3.0 ...

How do I use a filter action in Symfony?

Hi. How can I use filter action from page that not contain filter form (e.g. by submit or GET request)? When I pass parameters in the following URL <module_name>/filter/action?module_filters[_csrf_token]=62a17afab45d56382974f9a495abee7c&module_filters[id]=3998 I get an error in filter form: csrf token: CSRF attack detected. or ...

Indexing PDF files with Symfony using Lucene

I am a Symfony developer and my web server is Linux. I already use the sfLucene plugin. What is the simplest way of indexing PDF files for search on a Linux PHP server? XPDF, installed like this Apache Tika via the SOLR sfLucene plugin branch A 3rd option? Thanks! ...

How to begin learning CakePHP or any other MVC framework

I want to learn some MVC framework. I am trying to learn CakePHP by reading the docs on their website. But I am finding it very difficult to learn it. Can someone suggest a good way to begin learning CakePHP and provide some alternative websites? ...

Correct folder permissions for Symfony on Linux ?

I have moved my XP installation of Symfony (1.3.2) to Linux (Ubuntu 9.10). I now get a blank screen. Upon checking the Apache log files, I realised that apache daemon did not have permissions to create the cache folder. I used chgrp and chown to manually assign permission. When I then accessed the homepage, I got a 403 forbidden message...

Functional testing form with CSRF enabled in Symfony

What is the best way of creating functional tests to test forms with CSRF protection enabled in Symfony? Currently I have to add the following code before each form submittion: $form = new sfGuardFormSignin(); $token = $form->getCSRFToken(); $token_name = $form->getCSRFFieldName(); Then I add the $token and $token_name to form ...

how to secure an application by environment in symfony ?

i made a apps/frontend/config/security.yml dev: default: is_secure: false prod: default: is_secure: true but it is not working, am i missing something ? ...

Validating a date with symfony using sfValidatorSchema

I'm using the following widget to allow a user to input a date $this->widgetSchema['first_registration'] = new sfWidgetFormDate(array( 'format' => '%month%/%year%', 'years' => range(date('Y', time()) - 15, date('Y', time()) + 15) )); The default format for a date using this widget is %month%/%day%/%year% and so that's what the def...

Slot not being passed from action to layout in Symfony 1.4

I'm using the following to set a slot in an action but I can't retrieve it in the layout. $this->getResponse()->setSlot('global_message', 'You have already completed this contest.'); But if you set this in the template file, it works fine. Anyone have any ideas on this one? ...

Zend Framework plugins/modules

The symfony framework has a lot of plugins for adding functionalities like a user system (login, registration, authentication, etc..), so users won't have to invent the wheel from scratch, as a user system is a basic need for most applications (for example). I have tried finding an equivalent in Zend Framework, and though there is the c...

Symfony: How to redirect to a new page in an AJAX call?

Hi, I've got jquery sending an AJAX request that executes some checks and then should EITHER redirect to another page or return data. Everything works fine except I'm unable to force the redirect in my actions file. I've tried: $this->redirect('@new_page'); // DOESN'T WORK And... $this->context->getController()->redirect('@new_page'...