symfony1

How to use JavaScript in forms?

牧云@^-^@ 提交于 2019-12-11 05:56:02
问题 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(function(){this.blur()}); }); And I have override the method render as you show me but there is no error but it does nothing. I think it is a little error but I begin

Symfony/sfDoctrineGuard Conditional Permissions

巧了我就是萌 提交于 2019-12-11 05:48:03
问题 I'm contemplating the best way to implement the conditional permissions i.e. Users and Teams are m-to-m. But each Team also has a 1-to-m "Leader" relationship with the User table as well. For simplicity sake, let's say we have two permission levels, "User" and "Admin". Then lets say, only certain Team administration task i.e. group emails, can only be sent by that team's leader. At the moment, every action that is specific to team leaders queries the database to check it the current user is

doctrine:build-schema ignoring table columns

試著忘記壹切 提交于 2019-12-11 05:46:14
问题 I have a table called heading whose SHOW CREATE TABLE looks like this: CREATE TABLE `heading` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `referenced_table_name` varchar(255) NOT NULL, `column_name` varchar(255) NOT NULL, `label` varchar(255) NOT NULL, `position` int(10) unsigned NOT NULL, `import_profile_id` bigint(20) NOT NULL, `note` text NOT NULL, `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`)

Doctrine (in symfony project) can not connect through socket

最后都变了- 提交于 2019-12-11 05:38:57
问题 I am trying to put a symfony project on a client server for production. The website worked fine on our company's server, but now i have this error : 500 | Internal Server Error | Doctrine_Connection_Exception PDO Connection Error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Here is the database.yml : all: doctrine: class: sfDoctrineDatabase param: dsn: 'mysql:host=localhost;dbname=24DLJLRR1' username: xxxxxxxxxx password:

Symfony: Showing the dev toolbar in “prod” environment

给你一囗甜甜゛ 提交于 2019-12-11 05:37:31
问题 I managed to interactively set the debugging mode of my symfony application On and Off for a user session with something like this: $configuration = ProjectConfiguration::getApplicationConfiguration($app, $env, $debugging); I know that the Web Debug Toolbar showing up or not does not depend on the value of $debugging, but the configuration of the current environment. To this moment the only way that the toolbar appears is when $env = 'dev'. I'd like to activate it when accessing the "prod"

Symfony 1.4: How to manipulate the attributeHolder?

China☆狼群 提交于 2019-12-11 05:12:50
问题 I have an Attribute called 'admin_module' in myUser attributeHoler and i want to manipulate it...but i don't even get how to access the values stored there. I know how to get AttributeHolder in an action, but I don't have a clue, how to access the values in it. Any help appreciated...thanks in advance. ;) Edit after answers: get: $this->getUser()->getAttributeHolder()->set('beilagenbuchung.page', 1, 'admin_module'); set: $this->getUser()->getAttributeHolder()->get('beilagenbuchung.page', null

symfony link to change language and stay on the page

扶醉桌前 提交于 2019-12-11 04:38:50
问题 I would like to make a link the will be in the layout to change the language. So it should work for many routes. for example i'm on the page /en/myModule and the links should point to /de/myModule /fr/myModule I found a solution here :http://oldforum.symfony-project.org/index.php/m/70452/ <?php echo link_to( 'Germany', '@default?' . http_build_query(array( 'sf_culture' => 'de', 'module' => $sf_request->getParameter('module'), 'action' => $sf_request->getParameter('action')) ), null, '&')) ?>

Generating xls file from corresponding xml

风流意气都作罢 提交于 2019-12-11 04:38:26
问题 I have an Excel (xls) template with example data. I need to prepare an Excel file with dynamically- generated data. First, I made an XML file from the corresponding xls. The XML file looks like this : <?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html=

Symfony doctrine data-load segmentation fault

穿精又带淫゛_ 提交于 2019-12-11 03:57:07
问题 I'm working through the Symfony Jobeet tutorial and am getting a segmentation fault when trying to load data from my fixtures files. PHP 5.2.6-1+lenny8 with Suhosin-Patch 0.9.6.2 (cli), S symfony version 1.4.5 I'm using the Doctrine plugin. My fixtures below: /data/fixtures/categories.yml JobeetCategory: design: name: Design programming: name: Programming manager: name: Manager administrator: name: Administrator /data/fixtures/jobs.yml JobeetJob: job_sensio_labs: JobeetCategory: programming

Naming Generated Functions in Propel

╄→гoц情女王★ 提交于 2019-12-11 03:52:56
问题 The ideo of cross-reference tables is introduced in Propel 1.5. This means that an entity can get a list of related items as if it were a one-to-many relation. So in a person-to-groups relationship, a person can call getGroups() , and a group can call getPersons() . This makes things much easier to handle. However, if an entity has a many-to-many relationship to itself, the names of the function calls become more complex. As an example, the following permits groups to contain groups within