I have way too many modules in my application. Currently my modules are namespaced, but what I'd like to do is have a directory structure so I can get rid of this redundant and annoying namespacing.
For instance, for modules named "xModule1, xModule2, xModule3", I'd like to have a directory structure like this:
-x
-module1
-acti...
Throughout our site we have a login button, whenever someone logs in the button changes into "log out" and the users name is displayed next to it. Our server setup uses Varnish so we devised a way where a bit of javascript does a POST and we check if the user is Authenticated.
To avoid server overhead I thought it would be simple to jus...
I have a problem with the Admin Generator. The Table of Pages have the column sf_guard_user_id. The rest of the table looks as this part of the generator.yml in the line display,
list:
title: Pages
display: [=title, sfGuardUser, views, state, privacy, created_at, updated_at]
sort: [created_at, desc]
fields:
sfGu...
Is there a reasonably elegant means of writing a simple block of JS to the head of a Symfony layout?
I have a Page module whose showSuccess template is aware of how many widgets it has to display. I need to communicate that number to an external JS file included via use_javascript(). The only way I know to do it with any simplicity is t...
The official website seems only provided some tutorial on how to use:
http://www.symfony-project.org
But I want to know why the directories should be setup like this
...
Hi,
Is there a simple way to declare CSS classes for Symfony form labels?
This doesn't work:
<?php echo $form['email']->renderLabel('class' => 'my-css') ?>
Found this and it works but it feels counter-intuitive, as it makes the form labels themselves obsolete by requiring the label to be written out in the template:
<?php echo $for...
I'm now reading this tutorial,which is pretty good because it not only tells you how but also why.
http://www.symfony-project.org/book/1_2/10-Forms
But it's based on symfony 1.0,is there such a good tutorial for the newest version of symfony?
...
I've created an sfGuardUserProfile model that has a relation to the sfGuardUser model. Then I define another model with a relation to sfGuardUserProfile. I don't get any errors when I create the database, but when I try saving data to sfGuardUserProfile in my actions file, I get this error:
SQLSTATE[23000]: Integrity constraint viola...
I have several models with translations. When I load
$this->tour = $this->getRoute()->getObject();
por example, it gets me the Tour Object. However, it doesn't join to the tour_translation table; so when after i try to get it's title; symfony makes another sql query.
How I can override something, so in the Tour model when I ask for t...
Hi,
I have three tables forming a many-to-many relationship. They are,
WebUserRole -> WebUserRolePermission <- WebUserPermission
I've just started doing the admin for my WebUserRole object (using the propel:generate-admin), and I want the form for the WebUserRole to list the permissions with a check box next to each.
Now, is there a...
I'm reading a tutorial for 1.2,which says prototype is the built in library :
http://www.symfony-project.org/book/1_2/11-Ajax-Integration
What about the newest version of symfony?
I'm only familiar with jQuery,is there an easy way to replace the default by jQuery?
...
$this->getResponse()->addCacheControlHttpHeader('private=True');
What's that for,how does it work?
...
I want to generate test data for a fixture file. I wnat to generate the test data instead of having to type in hundreds of records.
Assuming my schema is as shown below:
foobar_department_def:
_attributes: { phpName: Department }
id:
name: { type: varchar(64), required: true }
foobar_qualification_def:
...
Im using the symfony framework with mysql.
I have a field in mysql that is generated by doctrine as:
weight: { type: double, notnull: false, default: NULL }
`weight` double(18,2) NULL DEFAULT NULL
The value is entered using a textbox and the generated sql trys to insert '' into this field if no value is given.
This produ...
Hi,
I've got a functioning form with a sfWidgetFormChoice that acts as a list of checkboxes. I'm able to set the checkboxes to "ticked" by default with the following:
'status' => new sfWidgetFormChoice(array('choices' => array(1, 2, 3), 'multiple' => true, 'expanded' => true), array('checked' => 'checked'))
... where the checkboxes a...
Hi,
I'm using the Symfony 1.4 mailer where I build the various bits needed for an email and then send it out using:
$this->getMailer()->composeAndSend($sender, $recipient, $subject, $body);
In the email body, I need to able to take advantage of variables generated in the action, so right now I might have this in my action:
$body = '...
Hello,
My layout.php calls include_javascripts() before my componet could call sfResponse::addJavascript(). Is there a "helper" or a "best practice" to handle this?
Do I have to Seperate the call sfResponse::addJavascript()? I were happy to avoid it.
Here ist my actual workaround:
<head>
<?php $nav = get_component('nav', 'nav') /* P...
I am using Symfony 1.31 for a brand new project. I have just created a module in the backend app, using the admin generator. To my suprise, it seems no theme ((At all) has been applied to the pages. As I mentioned before, this si abrand new project - I have not even modified the /app/backend/layout.php file yet.
I rember having a simila...
I want to use a datagrid in one of my modules (Symfony 1.3, Propel ORM). I have spent a while searching the web, but everything I found expects a direct connection to teh db (mySQL) or is otherwise unsuitable.
I found the datagrid plugin (http://symfony.swisscenter.com/datagrid/exemples), but the documentation/examples are in French - a...
Hello everybody,
I'm developing a Symfony 1.4 project where one of the tables has the Geographical template.
The present functions can give the distance between two records, but not between records and given coordinates.
How can be implemented such feature in Symfony way?
More specific: I need the records ordered by descending distanc...