symfony

Seriously speeding up PHP?

I've been writing PHP for years, and have used every framework under the sun, but one thing has always bugged me... and that's that the whole bloody thing has to be interpreted and executed every time someone tells my server they want the page served. I've experimented with caching, FastCGI, the Zend Job Queue (and symfony plug-ins that...

To populate select options at backend using Symfony?

the symfony form is, 'nation' =>new sfWidgetFormChoice(array('choices' => NationPeer::getAllNation())), 'township' =>new sfWidgetFormChoice(array('choices' => TownshipPeer::getAllTownship())), On selecting the nation (like India) it should populate township(with the township within India). I Dont want to use Javascripts! ...

Symfony TinyMCE Widget sfWidgetFormTextareaTinyMCE will show code at the end

Hi folks ! I'm working on my first symfony project (it's great !), i am using the sfWidgetFormTextareaTinyMCE widget for a form in the backend (to display the WYSIWYG). It works fine, but at the frontend, instead of showing me the formated text, i have the strong,p,... tags in the text. Same if i paste a youtube code for example. Does...

What's the best way to make small schema updates with Doctrine/Symfony?

What's the best way to make small schema updates to your symfony/doctrine application? My issue is, I'm working on a new side-project and occasionally find myself adding a new column here, a new column there as i find the need. However, my DB already has existing data and I dont want to run a complete rebuild and drop my DB with the ch...

How to disable a form element in symfony?

I am using a Select element, in form 'country' =>new sfWidgetFormChoice(array('choices' => CountryPeer::getAllCountry())), 'city' =>new sfWidgetFormChoice(array('choices' => CityPeer::getAllCity())), i want that city element to be disabled, at the first time when the page loads. and on selection of country the city element will be en...

Does Symfony have any weaknesses?

Hi, I am currently conducting a technical review of a web application that was developed by a third party. The used symfony framework. Are there any known issues that I should visit first? E.g. any security holes. Thanks in advance for help. Mark ...

Is there a way to set the default values for sfWidgetFormFilterDate widget?

I have an auto generated BaseBlahBlahBlahFilter.class file in my /lib/filter/base/ folder. It contain the following line for 'data' type field : 'date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)), When the form loads it shows me empty va...

How do I generate Symfony fixtures YML from exising database data?

I was wondering if anyone knew how to generate a fixture.yml from data that is already existing in the database? As you can use the build-schema to generate a schema, is there a way to do that for data? symfony propel:build-schema ...

Tracking the views of a given row

Hi there, I have a site where the users can view quite a large number of posts. Every time this is done I run a query similar to UPDATE table SET views=views+1 WHERE id = ?. However, there are a number of disadvantages to this approach: There is no way of tracking when the pageviews occur - they are simply incremented. Updating the ta...

Using Swift Mailer AntiFlood Plugin or Throttler Plugin with Symfony 1.3

What is the syntax for the using Swift Mailer Plugins in Symfony 1.3? Its not: $email = $this->getMailer()->compose(); $email->setSubject($subject); $email->setFrom($from); $email->setTo($to); $email->setBody($body, 'text/html'); $email->addPart($plain, 'text/plain'); $email->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30)); ...

To set custom error message in sfValidator?

How to add a custom error message in sfValidator, the form is $this->setWidgets(array( 'name' =>new sfWidgetFormInput(), 'country' =>new sfWidgetFormChoice(array('choices' => CountriesPeer::getAllCountries())), )); the validators $this->setValidators(array( 'name' =>new sfValidatorString(array('required'=>true)), 'country'...

How does one call the down method for a Doctrine migration in Symfony 1.2?

I am using Symfony 1.2 with the sfDoctrinePlugin. I couldn't find any command to call the down method on a migration, neither the documentation suggests any related arguments to the existing doctrine migrate command. What would be a way to rollback the migration I just ran successfully? Creating a new migration to undo is an option, but...

Using Symfony's sfForm standalone, without the rest of the framework

I've seen some posts and questions regarding this: how can I use Symfony's sfForm as a standalone library? Just for managing a simple "hand-made" form but without the bulk of the framework. ...

Table Widget in Symfony

Is there a table widget for Symfony? I know there are people who planned to build this, but don't know whether it got incorporated into Symfony or not. It would be tremendously useful if table widget is available and all we have to do is to bind the array to it and it will show. ...

issue about selecting objects in an inheritance context in propel-symfony

Hi, I have an issue that is quite annoying with symfony 1.2 and propel. I have a model where I have implemented inheritance using the single-table strategy. So, here is an excerpt of my model: Ad (id, posted_date, description) then RealEstateAd(location, price, transaction_type) and JobAd(position, requirements, company) which inherit bo...

[apc-error] Cannot redeclare class sfconfig

I am running Symfony (1.2.9) with PHP Version 5.2.11 on Windows XP. I have APC installed (Version 3.0.19) I can run PHP script to prove that apc is working correctly (works). However, when I try to use APC calls in a symfony action, I get this error (in the apache error.log file): [apc-error] Cannot redeclare class sfconfig Which pro...

Symfony : How to use widgets with i18n forms in backend (doctrine)

Hi everybody. I can not manage to have both i18n and tinyMCE widgets on internationalised fields. If i put both, i will have internationalised fields for all my objects' fields, but no tinyMCE for them. I will have as much tinyMCE fields as i declared, but thew will not correspond to any language, they will be at the beginning or at the...

How do I setup Symfony to create multiple database schemas?

In my project I have 2 databases. propel-build-model is already set up to work for 2 databases - http://stackoverflow.com/questions/733224/multiple-databases-support-in-symfony If I make changes to either of the databases, I need the propel-build-schema command to rebuild the schemas for both. I know I can do this manually by amending ...

How can I obfuscate a Symfony PHP Web App?

Hello, I am looking to distribute a symfony web app, but don't want to reveal its source code. I know it is tough to obfuscate PHP, but I was wondering if there are any closed or open source solutions to obfuscate and/or encode the backend code so that someone receiving the app can run it but wouldn't be able to view the source code? ...

Switch symfony 1.4 from doctrene to propel

How can I properly switch the newly installed Symfony 1.4 framework from Doctrine (that it is configured for by default) to Propel? ...