symfony-1.4

What are the options for Doctrine's addColumn() migration method?

The API gives the code as: public function up() { $this->addColumn('table_name', 'column_name', 'string', $options); } but there's no documentation for what can be included in the options array. http://www.doctrine-project.org/Doctrine_Migration_Base/1_2#method_addcolumn ...

Customizing symfony autogenerated forms

I'm trying to use auto-generated forms in symfony, but I have troubles finding good up to date articles about customization. One of the most important thing is - queries from / updates to several tables. Specificaly, example: there's table tblMain and auto-generated class tblMainForm I use. However, column ForeignKey references to tblAd...

A little help using Symfony

Can anyone link me to some Symfony resources, they are hard to find. I am having a little trouble understanding how to use it correctly. Like with CodeIgniter to use the security helper you would load it doing this: $this->load->helper('security'); And you would use its functions you would do something like this: $data = $this->input...

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 ...

generating url Symfony sfFormExtraPlugin autocompleter

Autocompleter has a required option - url. Problem is, it is used in Form.class where neither url_for() nor $this->getController()->genUrl() works. All the examples I saw use url as literal string, i.e. $options = array('Model' => 'Model', 'url' => '/path'); Maybe I'm getting something wrong, but I believe writing urls as string is no...

Symfony sfFormExtraPlugin ajax error

I'm getting this error in Firefox javascript console. Does it mean jQuery UI is badly configured or is it programming error, e.g. bad values returned by ajax symfony action? I'm using sfFormExtraPlugin plugin's DoctrineAutocompleter... or trying to use it. Error: jQuery("#autocomplete_table1_table2").autocomplete("http://myurl/fr...

Is symfony's autoloader clever enough to only load necessary files?

I know symfony can autoload files with spl_auto_register,but is it clever enough? If only a.php is needed to load,will it also load b.php? ...

disable layout for sfDoctrineGuardPlugin in Symfony

How could I prevent mentioned plugin's login form from using default layout? I am aware of this question, but that answer doesnt work for me. For starters, there's no signin module in modules dir, probably plugins handle it in different way, I dont know. Just learning symfony. Thanks in advance :) ...

How can I change my admin theme in symfony 1.4?

I am using sfAdminJrollerTheme Plugin for some parts of my application, but when I generate new modules without admin generator, I lose same look and feel than jroller in my other application pages. I know maybe is good idea to use admin generator for everything but I cannot change all my modules. Regards, ...

How to use less memory while running a task in Symfony 1.4?

I'm using Symfony 1.4 and Doctrine. So far I had no problem running tasks with Symfony. But now that I have to import a pretty big amount of data and save them in the database, I get the infamous "Fatal Error: Allowed memory size of XXXX bytes exhausted" During this import I'm only creating new objects, setting a few fields and...

symfony save submitted form to database

Maybe I am missing something, but in symfony examples, in form submission action there's nothing which indicates form data is saved to database. (link). How can I save everything to db? Example from the link: public function executeSubmit($request) { $this->forward404Unless($request->isMethod('post')); $params = array( 'name'...

symfony 1.4 adding a BCC recipient to mailer

I know with swift directly you can create a Recipient_List and do ->addBcc() . How would i do this same thing in the context of symfony 1.4 $message = $this->getMailer()->compose(); $message->setSubject(sfConfig::get('app_email_welcome_subject')); $message->setTo($user->getUsername()); $message->setFrom(sfConfig::get('app_email_from'));...

What's the best way to customize / add pages to the admin generator?

I'm using Symfony 1.4 and Doctrine. My application's backend was built using Symfony's admin generator. It works great when I want to display basic stuff. But tehre's not a lot of documentation on how to enhance it and add new pages. Let's take an example: I want to list published items on one page and to-be-published items on another...

How to create a custom yaml config file in Symfony

What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directo...

Logging from symfony's model layer

I'm currently working on a project with symfony 1.4 and Doctrine 1.2. I'm looking for a proper way to do logging from the model layer. In some model classes I use the record hook postSave() to create a ZIP file using exec() (since PHP zip doesn't provide for storage method 'Stored'). To be sure that everythings works fine I check the re...

Render a partial from a task in Symfony 1.4

I'm trying to render a partial in a Symfony task and having no luck. I found docs in 1.1 that say to just call get_partial() but apparently that's no longer readily available in 1.4. I tried loading the helper manually with sfLoader::getHelpers('Partial'); but I get "Class sfLoader not found". Any help would be greatly appreciated. F...

How to simulate an error 500 in Symfony 1.4?

I created an error500.php file in web/errors/ and would now like to test it. I tried to put this line in one of my actions: $this->getResponse()->setStatusCode(500); Unfortunately it looks like it's ignored. Do you guys have any idea of what's happening here? I'm using Symfony 1.4. Edit: Firebug is telling me that the error is act...

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 1.4: Storing an array in session with SetAttribute

Hi, I'm wondering if someone knows how to store an array into a user session? This is the method to store a single attribute: $this->getUser()->setAttribute('something', $something); And the documentation says: "User attributes can store any type of data (strings, arrays, and associative arrays)" ... but doesn't say anything more....

Fixtures and inheritance in Symfony

Hi! I have a database schema in Symfony like this: Persona: actAs: { Timestampable: ~ } columns: primer_nombre: { type: string(255), notnull: true } segundo_nombre: { type: string(255) } apellido: { type: string(255), notnull: true } rut: { type: string(255) } email: { type: string...