symfony

Displaying form validation errors in a template (Symfony)

Hi, let's say I have a blog with a module "post". now I display a post like this: post/index?id=1 in the index-action i generate a new CommentForm and pass it as $this->form to the template and it is being displayed at the bottom of a post (it's just a textfield, nothing special). form action is set to "post/addcomment". How can I di...

Symfony 1.2: question about a line in an action

Hi, this action is generated in symfony 1.2 when you create a module: public function executeUpdate(sfWebRequest $request) { $this->forward404Unless($request->isMethod('post') || $request->isMethod('put')); $this->forward404Unless($usuario = Doctrine::getTable('Usuario')->find(array($request->getParameter('id'))), sprintf('Obje...

Can I make a symfony sfValidatorFile required ONLY if the action is 'new' ?

I have an admin form that lets users create entities that require an image. So in the form class, I have a sfValidatorFile object that sets the 'required' option to true. This is perfect behavior when the user creates a new entity. The problem arises when they edit an existing entity. They shouldn't have to select an image every time the...

TO_DATE in DQL (DOCTRINE)

What's the problem with this DQL ? When I remove the TO_DATE in GROUP BY "it's work", between I need it there! SELECT COUNT(t.codigo), TRUNC((t.dataCadastro - TO_DATE('2010-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'))/1)*1 + TO_DATE('2010-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS') FROM TarefaNegociacao t GROUP BY TRUNC((t.dataCadastro - TO...

Benefits of Doctrine array column vs custom serialization?

I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized array as a JSON object in the database. I see that Doctrine has an array column that does similar serialization. Is there any performance benefit to the array column verses having custom json_decode/encode getters and setters? What serializati...

How do you: Symfony functional test on a secure app?

Im trying to perform some function tests in symfony 1.4. My application is secure so the tests return 401 response codes not 200 as expected. I've tried creating a context and authentication the user prior to performing the test but to no avail. Any suggestions? Do I need to pass sfContext to the sfTestFunctional? Thanks include(dir...

Code ran before every action within symfony

I have code that I want to be executed before every action is called. Are there action hooks I can use for this? ...

symfony doctrine build-sql error

I have some big problems with symfony and doctrine at the beginning of a new project. I have created database diagram with mysql workbench, inserted the sql into phpmyadmin and then I've tried symfony doctrine:build-schema to generate the YAML schema. It generates a wrong schema (relations don't have on delete/on update) and after this I...

about httpd.conf

Hi I'm starting to learn symfony for php framework and I got problem with httpd.conf configuration. First, I have xampplite installed on my windows c:\xampplite\ and then I created a symfony project (as described on getting started guide) c:\xampplite\htdocs\symfonytest\ Everything works fine when I tried to access http://localhost/...

Is possible overwriting a Doctrine model in Symfony?

Hi, is possible overwriting a Doctrine model in Symfony? I'm trying no change a "notnull" property, but i can get it.. In 'plugins/sfDoctrineGuardPlugin/config/doctrine/schema.yml': sfGuardUser: actAs: [Timestampable] columns: id: type: integer(4) primary: true autoincrement: true username: ...

Best practice: joining two templates of two plugins

Hi, i have the a login (sfDoctrineGuardPlugin) and a signin (sfDoctrineGuardExtraPlugin) form. Any advice to join them in the same template? Regards ...

Symfony: after "build-all-reload" password is not encrypted

Hi, just that. I have installed sfDoctrineGuardPlugin. Any idea? Javi ...

Doctrine 1.2: How do i prevent a contraint from being assigned to both sides of a One-to-many relation?

Is there a way to prevent Doctrine from assigning a contraint on both sides of a one-to-one relationship? Ive tried moving the definition from one side to the other and using owning side but it still places a constraint on both tables. when I only want the parent table to have a constraint - ie. its possible for the parent to not have an...

Get #part in URL with PHP/Symfony

Hi, I'm working with Symfony 1.2. I've a view with a list of objects. I can order them, filter them by category, or moving to the next page (there is pagination). Everything is done with AJAX, so I don't have to load all the page again. What I want to achieve is to have http://urltopage#page=1&order=title&cats=1,2 for example; ...

symfony: multiple apps, single login?

My symfony project is divided into several apps. Using the sfDoctrineGuard plugin I'd like to create another app just for login, and redirect to the appropriate app after login. My questions: • Is this advisable or does it go against how sfGuard is supposed to work? • Is there a way to redirect between applications without hardcoding ...

The best database table layout/design for a custom ticket system

I'm developing a custom trouble ticket system for network management and trying to find the best database table layout for following scenario: There are tables representing PON, T1 and T3 lines. Each line may have one or more trouble tickets, but every trouble ticket has some unique fields depend on what type of line this tiket belongs....

Symfony, in remote host: Error 500. Unknown record property / related component "algorithm" on "sfGuardUser"

Hi, after deploying, i get the error below after loggingin. Sf 1.3, sfDoctrineGuardPlugin. And i have this schema.yml in config/doctrine: Usuario: inheritance: extends: sfGuardUser type: simple columns: username: type: string(128) notnull: false unique: true nombre_apellidos: string(60) sexo: ...

Can't get custom error rendering to work in symfony 1.4

I'm tring to customize error rendering in my form according to this example. Here is my code: if ($this['message']->hasError()) { $error_msg = '<ul>'; foreach ($this['message']->getError() as $error) $error_msg .= "<li>$error</li>"; $error_msg .= '</ul>'; } return $error_msg; but when $this['message'] has error this code retur...

Symfony: difference between Action+partial and a Component

Hi, why should i use a component instead of an action that renders a partial? If actions can render partials, when is better using components? Give me light about it.. Javi ...

Data-separation in a Symfony Multi-tenant app using Doctrine

I am trying to implement a multi-tenant application, that is - data of all clients in a single database - each shared table has a tenant_id field to separate data I wish to achieve data separation by adding where('tenant_id = ', $user->getTenantID()) {pseudoc-code} to all SELECT queries I could not find any solution up-front, but here a...