symfony

Using routes to generate URLs in a Symfony task

I am running Symfony 1.3.6 on Ubuntu 10.0.4 LTS. I have written a Symfony task that generates a report which contains links (URLs). Here is a snippet of the execute() method in my task class: protected function execute($arguments = array(), $options = array()) { //create a context sfContext::createInstance($this->configura...

How to display a sfWidgetFormSelectRadio item without showing the label

I am using Symfony 1.3.6 on Ubuntu 10.0.4. I am using the sfWidgetFormSelectRadio to allow a user to select a picture from a list, in a form. In the action, the pictures are set up like this: $this->form->setWidget('chosenpic', new sfWidgetFormSelectRadio(array( 'choices' => $this->pictures, ...

Saving parent/child header/line using Doctrine 1.2

I have a simple parent-child/header-line model in my project. The problem is that its creating a cyclic relation or something, and not letting me save the parent without the child! Detect relations is switched off! detect_relations: false ... BillHeader: package: Billing tableName: Bill_Headers actAs: SoftDelete: ~ columns: ...

Set value to Symfony custom select_month_tag item

I am using the select_month_tag and select_day_tag in a new Symfony 1.0 project (I know, out of date, but it's what we're using). In any case, when using the tag I know I can set the default first item in the select object to a custom item by using 'include_custom'=>'My Custom Value'. However, by default, Symfony does not give this fir...

Can't delete objects due to foreign key constraints

This is a strange one Take this schema: Contact: actAs: [Timestampable,SoftDelete] columns: first_name: { type: string(255), notnull: true } second_name: { type: string(255), notnull: true } relations: Forums: class: Forum refClass: ContactForum local: forum_id foreign: contact_id fore...

Need help with: Couldn't call Doctrine_Core::set()... symfony 1.4 fixture

I keep getting: Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting one-to-many references. This happens when I include data for 'asset' in the 'Upload' table in my fixture. See part of the schema.yml below: detect_relations: true options: collate: utf8_general_ci char...

PHPUnit coverage now incomplete as class' opening brace is not covered.

Hey everyone, I've been using PHPUnit to to do unit testing on a Symfony/Doctrine project I'm working on. It was working fine until yesterday when various classes dropped from 100% coverage to 98-99%. The reason for the change is because the opening left brace of these classes is no longer considered "covered" for some reason. Here's a s...

symfony command line does nothing

Hi there! I am having some problems executig the symfony command on my project root directory. Some useful information: symfony file permissions: -rwxr-xr-x 1 root root symfony file content: chdir(dirname(FILE)); require_once(dirname(FILE).'/config/ProjectConfiguration.class.php'); include(sfCoreAutoload::getInstance()->getBaseDir()...

Redirecting to 404 page

I have the following code in a PHP script: <?php if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } // Other statements follow here echo 'Hello there ...' instead of echoing the message, I want to redirect the...

Symfony 1.4 - Updating hidden value when form is updated

Hey I am trying to modify the default value of a form field every time the form is updated. I have tried to edit the $form->bind in my processForm (..) but I am unsure how to do so. Is it possible to get some example code or any approaches to do? The field name is 'processed' and I am trying to set the value to 'false' - Using Symfony...

Fieldset implementation in Symfony forms

Hello, on the project I am writing with Symfony, there will be fieldsets in forms very often, so I would like to create a mechanism so that I can group fields by fieldsets and still use the __toString() method of my forms. On this page, I read about the sfWidgetFormSchema, and how it could be considered as a widget, which enables to nest...

How put a Task (sfBaseTask) in unitest ?

How i can write an unit test, for my Task (sfBaseTask) ? ...

How to add a script onLoad ?

Hello, I have to add a Javascript onLoad on a tag : I have a form and I want to disable an input at load. How can I do this with symfony please ? I have to do this only for forms, so I can't add it in the tag of the layout ...

Doctrine : Hydrate doctrine collection with another model than the FROM clause

Hello, On my application, i frequently do doctrine query like this : $coms = Doctrine_Core::getTable('Comment') ->createQuery('c') ->join('c.article a') ->join('a.Writter w') ->where('w.something = ?', $something); I want to extract the comments from articles with a condition on the writter. Le query start from the Comment Table (...

Temp-Files in Symfony-Cache folder

Hi, I'm using Windows on some production machines (IIS with FastCGI-PHP). Since the update of one SF-Project to 1.3.x I notice some strange problems. The Server is "collecting" Temp-Files in the config-cache folder of the applications. They are named like con1718.tmp and always containing the autoload-config-cache. The tmp-files are not...

Two scripts Javascript doesn't work together

Hello I have two scripts in a file active_form.js The first script hides a text entry when a radiobutton is checked and the second does the same thing when a value is selected in a list. When there are alone, the both work but together my function GereControleRadio do nothing. edit : the two scripts are called in the same form. The ...

Are the XLIFF translation files (I18n) in Symfony case-sensitive?

Had a quick doubt... Are the XLIFF translation files (used by I18n Helper) in Symfony case-sensitive? Will _('Hi') & _('hi') both fetch different results? What if the XML only has a hi? Thanks ...

symfony generating absolute URLs in symfony tasks

Hi, I have a quick question regarding the creation of absolute URLs within a symfony task. Basically I have the following: /** * This function returns the link to a route * * @param $context context from which to create the config from * @param $routingText this contains the text to be routed * @param $object if we ar...

How do you validate/save an embedded form based on a value in the parent form in symfony?

Hi, I have a symfony 1.4 form with 2 embedded forms. The parent form has a drop down which determines which of the embedded forms you fill in (hidden/shown on the frontend using JavaScript). The problem is, when I submit the form, the validation and save is being run on both of the embedded forms, which I obviously don't want. What i...

foreach returns more elements than count()

Hi, I'm using Symfony 1.2.7 and Doctrine 1.1. I have $activities (sfOutputEscaperIteratorDecorator - Doctrine_Collection). I'm escaping everything on settings.yml with ESC_SPECIALCHARS method. If I weren't escaping it, it would work without any problem, so I think the problem is related with sfOutputEscaperIteratorDecorator. If I do ec...