I'm still fairly new to symfony, so my apologies if this is a stupid question. I'm using symfony 1.4 with Doctrine. My colleague wrote a JavaScript to make a report from our client side widget to our server:
$j.post(serverpath, {widget_id:widget_id, user_id:user_id, object_id:object_id, action_type:action_type, text_value:stuff_to_repor...
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...
How i can write an unit test, for my Task (sfBaseTask) ?
...
I have a doctrine model that has a method getSomethingId()
and I'm making something of an automated form generator for internal use in the company
how can I check if my model has this method?
I've tried with php's method_exists but it returns false for every method, what can I do?
thanks
...
Symfony seems to have a problem opening a database connection while running unit test. I have my test env specified in config/databases.yml:
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=localhost;dbname=ms'
username: ms
password: xxx
test:
doctrine:
class: sfDoctrineDatabase
par...
distance_of_time_in_words(strtotime(2010-08-07), strtotime(2010-08-01))
returns '6 minutes'
$a = '2010-08-02 00:39:29'
$b = '2010-08-01'
distance_of_time_in_words($a, $b)
returns 'less than a minute'
$a = '2010-08-02 00:39:29'
$b = '2010-08-01 20:08:00'
distance_of_time_in_words($a, $b)
returns 'less than a minute'
I wonder if I...
I have the following schema definition:
Usuario:
columns:
empresa_id: { type: BIGINT, notnull: true }
direccion_id: { type: BIGINT, notnull: false }
publicidad_id: { type: BIGINT, notnull: true }
tipo_id: { type: BIGINT, notnull: true }
nombre: { type: string(60), notnull: true }
paterno: { ty...
Is there a simple way to modify/customize error messages generated by Symfony validators?
eg. When using a string validator, if the field is empty,
then the message "Required" is displayed by default with the field.
This surely comes from its class, but is there a way to change the message for the String Validator globally so that it...
Hi all,
A quick question. I have a symfony form. When I save the form, I want my created_by field to be set automatically on save.
So, i'm passing the current user id as an option in the form:
$this->form = new ContractForm(null,array("created_by"=>$this->getUser()->getId()));
And in the configure method of the form class I have:
$...
I'm rendering a partial from inside a task in symfony 1.4.6...
$this->configuration = $this->createConfiguration(app, env, false);
$this->configuration->loadHelpers(array('Partial'));
$context = sfContext::createInstance($this->configuration);
$html = get_partial(partialName, params);
...Inside the partial there is a reference to a c...
Hi,
Can someone explain to me why the following code isn't outputting anything in a component? Does the response object in a component behave differently from that in an action (since the code works as part of an action)?
I am using Symfony 1.4.
$this->getResponse()->setContent("OK");
Code block:
class merchantComponents extends s...
I am attempting to send an HTML email from a symfony (1.4.6) task, I don't want to send the entire rendered HTML output from a particular module/action, so I am rendering a partial. That's all fine, the issue is that the partial contains CSS references.
Is there a nice 'symfonic' way of including a CSS file in an HTML email from a symfo...
I'm getting a weird error in symfony 1.4 with doctrine 1.2. My schemas seem to be normal. But whenever I execute the doctrine:build --all --no-confirmation --and-load task, it would output the error SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'default_edition_id' cannot be null. If I set notnull to false for the default_...
The prototype of embedRelation makes reference to an 'options' array (passed as $formArguments/$formargs).
Is it possible to pass an options array:
embedRelation("Model","ModelForm",$options_arr);
Where the options_arr contains form validator/widgets/etc to set for the relation?
$formargs['something']['publish_date'] = new sfWidget...
I'm using symfony 1.4 and doctrine. I've spent the last couple days playing with my schema, and I've gotten it to load up / build / behave properly but only on my local machine. When I copy the files to an account on Dreamhost, change the configuration to allow a connection to that database (and nothing else) I get the following error tr...
With Symfony 1.4's Forms, how can I throw a sfValidatorError in the post validator of an embedded form?
My parent form calls the following:
public function configure(){
$this->embedForm('page', $pageLinkForm);
}
And my embedded form:
public function configure(){
$this->validatorSchema->setPostValidator(new sfValidatorCallbac...
Hi Volks,
I have a weird problem with my i18n doctrine schema and i.a. the admin generator.
(Please look at the edit part below first)
The schema looks like:
CargoSize:
connection: doctrine
actAs:
Timestampable: ~
I18n:
fields: [name, linkname, seoname, description]
tableName: com_cargo_size...
I am currently working on some symfony form customisation which includes writing widgets or better still extending existing ones.
However this proves to be much more complicated as I thought it would as the functionality for validating, form elements, object saving, dynamic javascripts and so forth seem to be scattered all over the plac...
What I'm trying to do is relatively simple but I can't find documentation.
Let's say I have a model Thing with a field label. The label field is internationalized.
How can I update all label fields from a model or an action?
(I'm using Doctrine)
...
$this->facebook_applications = Doctrine::getTable('FacebookApplication')
->createQuery('a')
->execute();
I don't understand how this works at all. Why is the query just 'a' and why does that seem to get a list of the applications?
...