symfony

Symfony: sfError404Exception: This request has been forwarded to a 404 error page by the action...

When building a website in Symfony 1.3 my development server refuses to display my custom 404 page. I have left the config settings as standard, so my error module is the default, as can be seen in my debug toolbar: sf_error_404_action: error404 sf_error_404_module: default This request has been forwarded to a 404 error page by the a...

How to use sfNumberValidator?

Hi, I have a problem : I try to use the sfNumberValidator, but it doesn't work. This is my validator.yml file : methods: post: [lib_modele_controle, frequence_controle, intervenant_controle, delai_alert_controle, mode_operatoire_controle] fillin: enabled: true # Active la repopulation names: delai_alert_controle: re...

How to use Stored Procedures with Symfony and Doctrine

Hello I having problems at trying to call a MySQL Stored Procedure with Symfony 1.4 and Doctrine 1.2. What I want to do is the following: In a module/new after typing all the data in the form, I want to insert one of the values in another table. I don't know if this can be done with Doctrine without using a stored procedure. Thank...

Symfony one-to-many embedrelation showing multiple forms

I'm having what should be a simple problem with Symfony. In this example I have a User, LookingFor, and LookingForNames table. The user table holds the user account and has a relation with LookingFor. The LookingFor table holds any relations between a user and the LookingForNames. Example: The user 'chain', could have two entries in...

problem with image paths using sfFacebookConnect on a facebook app

using FBML my app is giving the following error: HTML error while rendering tag "img": Relative URLs not allowed here The same thing happened to me when working on apps not in symfony and the easiest solution was to just include the absolute url in either hard code or a constant. Does anyone know any more elegant solution using symfo...

How to translate this SQL query with propel ??

Hi, i don't know how to translate this query : SELECT distinct(id_ville) FROM `point_location` I try to do it, but it doesn't work : $c = new Criteria(); $c->add(PointLocationPeer::ID_VILLE, Criteria::DISTINCT); $c->setDistinct(); $this->villes = PointLocationPeer::doSelect($c); ...

Unable to read cache file (symfony.routing.data.cache)

Hi, We are having some troubles when many people is visiting our site at the same time. We are using Symfony 1.2.7 + Memcached on Amazon Web Services. We have 2 instances running Apache with load balancing. Database is MySQL and it is running in a separate instance that stores de web files (the other instances are mounting these files u...

sfLucene in Symfony 1.3 or 1.4

Has anyone taken the sfLucenePlugin and made it work in Symfony 1.3 or 1.4? The plugin requires pake functions and the new config class to be adjusted but looks like it could be done if persistent. I have seen the Jobeet tutorial for implementing Zend Lucene but am not keen to lose all of the .yml functionality that sfLucene provides. ...

auth problems (security filters) in sfGuardUser Symfony

Hi, I'm using Symfony 1.2.7, and sfGuardUser Plugin. I'm able to view all the pages, login and logout. However when I try to edit (just going to the form) or update an object (saving the changes) sometimes I have problems of auth, and symfony redirects me to the edit form page again. I put some emphasys on sometimes because it's what it...

How can I bootstrap Symfony into a standalone script?

(I hope 'bootstrap' is the correct term...) I have a Symfony 1.4 project in which I'm using a PHP script that mostly contains Javascript (I'm including this script with a simple <script src="/js/myStuff.js"></script> tag). I need to use some Symfony classes, helper methods, and variables from within the script (specifically the sfConfig...

Issues with Doctrine Versionable (Audit Log) Behavior

Hi, Im using the Doctrine versionable behavior for one of my models. The schema works fine & tables are created. But when I try to load fixtures for this, I get a fatal error saying class TaxCodeVersion not found. I checked my Model dir, and indeed the class TaxCodeVersion is not generated by Doctrine. I always use the build --all --no-c...

symfony: question about a choice widget

Hi, I have a choice widget in a form: $years = range(14,130); $this->widgetSchema['age'] = new sfWidgetFormSchema(); foreach (array('from', 'to') as $value) { $this->widgetSchema['age'][$value] = new sfWidgetFormChoice(array( 'label' => $value, 'choices' => array_merge(array('' => '-'),array_combine($years,$ye...

Symfony: question about the form filters

In the frontend I have a page with a list and a form filter next to it that shows all the users of a social network. I would like to hide the user of the session in that list. How can I do it? My first thought is creating a function, addXXXXColumnQuery(), for each field of the form, and in each one add a line like this: ->andWhere("u....

Symfony and Eclipse: I can not go to the function or class using F3.

I'm using Eclipse (Build id: 20090920-1017) to write my Symfony web application and in many cases I can not "go" to the declaration of functions or classes (you know placing the cursor where the class or the function is called and then pressing F3). For example: I have this class: class UsuarioFormFilter extends BaseUsuarioFormFilter{ ...

[symfony] How to use JavaScript in forms ?

How to add your own JavaScript to the forms which are generate by Doctrine ? For example, where can I add a script onFocus in an input form generated by symfony ? Edit : @Benoit : I have tried your method but, it doesn't work. My function renderJavascript : public function renderJavascript() { $(function() { $('.form').focus(...

Symfony propel:insert-sql with specified user?

I am running Symfony 1.3.6 on Ubuntu Lucid. My db connections for Symfony are made with a user with reduced priveleges (no need for CREATE or DROP for example) - for security reasons. I want to be able to run the propel task propel:sql-insert as root, so that I can create/drop tables at will. The brain dead way to do this would be to m...

Apache configuration for Symfony website with virtual hosts

I'm trying to configure my local Apache2 server to host several Symfony websites using virtual hosts, but I just can't make it to alias lib/vendor/symfony/data/web/sf directory as /sf. I see that using %1 and %2 in alias statement is the source of the problem, but I can't find the right solution. I added to /etc/hosts entry 127.0.0.1 job...

The WHERE IN clause using propel in symfony

Hi, I am new to symfony and propel . How can I create the following query using propel ? "UPDATE tablename SET status = 1 WHERE id IN (1,2,3,4)"; Thanks. ...

Symfony: question about routing and slugging

In order to not show the ID's of the members of my social network in the URL, I have created this route: perfil_miembro: url: /miembros/:nombre_apellidos class: sfDoctrineRoute options: { model: Usuario, type: object} param: { module: miembros, action: show} And added this line in the show action: $this->usuario = $this->getR...

Showing default widget value only when object value is not set (in NEW mode)

THIS QUESTION IS NOT ABOUT HOW TO SET DEFAULT VALUE OF A WIDGET Hello Symfonians! I had a fundamental doubt about forms, Im putting 2 scenarios below. I have a customModelForm that extends a modelForm. 1> If I do not specify a default value for a form field new: field is empty edit: field shows the value in the object 2> If I ...