symfony1

Why this schema is generating a relation n:m

99封情书 提交于 2019-12-04 05:56:43
问题 I've this schema.yml file (just relevant part): SdrivingMaquina: actAs: Timestampable: ~ columns: idmaquina: { type: integer(8), autoincrement: true, notnull: true, primary: true } idempresa: { type: integer(4), notnull: true } patente: { type: string(12), notnull: true } relations: Empresa: { local: idempresa, class: SdrivingEmpresa, type: one, foreignType: one, foreignAlias: MaquinaEmpresa, onDelete: CASCADE, onUpdate: CASCADE } SdrivingMaquinaEmisor: actAs: Timestampable: ~ columns:

What framework(s) would you suggest for a strong, extensible dev platform? [closed]

你说的曾经没有我的故事 提交于 2019-12-04 05:50:26
First, let me apologize for Yet Another Framework Question. But I think this is different enough from the usual "What framework should I choose?" to warrant it. Here's my situation: For the past year I've been using a custom framework. It's been used on everything from small CMS's to larger sites and even a mid sized social network. It's worked great but I now see its limitations. So, I've decided to switch to a 3rd party framework. The simpler frameworks (CI, Kohana, Cake) seem too inflexible from what I've heard - so this led me towards ZF. But, I've also heard that ZF may be too flexible

Symfony as a helper for Wordpress plugin development

陌路散爱 提交于 2019-12-04 05:16:23
I have seen several integrations between wordpress and symfony, but they are made with the goal of managins static pages content inside wordpress and symfony acting as the controller. Wordpress plugin development api seems really basic and primitive and you have no way o code with the MVC pattern out of the box. So the big question is, what would be an starting point to create plugins in wordpress, and create admin sections in it, but using Symfony power to manage database access, form creation and validation, etc ..... I had briefly considered a similar approach for integrating Lithium with

Symfony - Is it possible to disable output escaping per module (or per template)?

心已入冬 提交于 2019-12-04 04:50:06
I'm trying to output some HTML in an XML template and Symfony's escaping method is messing it up. So I tried making a copy of settings.yml in the module's config folder, but it seems to be completely ignored. Is there an easy way to change the escaping_strategy and/or escaping_method settings per module or even per template? While output escaping is turned on you still have access to the raw value through $sf_data . For example, if the HTML you're trying to output was stored in a variable called html in your action: $this->html = '<b>My HTML</b>'; You could get the unescaped value with this: <

Symfony $request->isXmlHttpRequest() issue

萝らか妹 提交于 2019-12-04 02:34:15
I need to check if the request is ajax. $request->isXmlHttpRequest() works fine, however if there is a redirect somewhere during the execution, this method will return false. How else can I check if request is ajax in this case? p.s. ajax is initiated by jQuery prodigitalson If you arent redirecting to a different application in your project or another external uri just use forward instead if isXmlHttpRequest is true on the first request. Well that method checks against the value of the X-Requested-with header and in some browser implementations that header (or all original headers) are

Best way to get request object from within Symfony forms?

邮差的信 提交于 2019-12-03 22:23:23
问题 I use Symfony and Doctrine to generate forms for my CMSes. Lately I've been customizing them by setting default values based on specific URL parameters. For example, I have two models: PollQuestion and PollChoice . PollChoice has a relation to PollQuestion by means of a poll_question_id field. The PollChoice form has a dropdown that lists all the available PollQuestion s that the PollChoice can be attached to. I also have two routes: pollchoices/new and poll/:poll_id/choice/new . Both routes

Set Mime_type validation in Symfony

放肆的年华 提交于 2019-12-03 21:56:19
I want to make sure that during file upload time, only the file of the format jpeg, png and gif are allowed. So the "File of type:" below in the screenshot must show jpeg, png and gif: http://lh5.ggpht.com/_SDci0Pf3tzU/ScynOZt_0qI/AAAAAAAAEo0/gMr_zxYofV4/s400/styleerror.png I did the following for my validator in Symfony: $this->setValidator ( 'upload your filehere', new sfValidatorFile ( array ( 'required'=>true, 'mime_types' => array ('image/jpeg, image/png, image/gif' ) ) , array( 'mime_types'=> 'only jpeg' ) ) ); but when I click on the upload button, the files are not filtered accordingly

What is the best forum plug-in solution for the Symfony framework?

本小妞迷上赌 提交于 2019-12-03 20:27:11
I'm looking for a good solution to integrate a forum into a symfony application. Something like phpBB would be excellent. I've seen phpBB plugins to integrate with symfony but that's not enough for my purposes, also, mapping database tables is a lame approach in my opinion. If anybody knows a good working forum component for Symfony then I would really apreciate it. :) Also, it needs to work with Doctrine. Thanks! I've found sfDoctrineSimpleForumPlugin Thanks for all the responses, hope this works :) ! The author made even some changes today after this post If you're discounting the

Which unit testing framework do you use for Symfony?

江枫思渺然 提交于 2019-12-03 16:44:30
Which unit testing framework do you use for Symfony? Lime or PHPUnit? What are the pros and cons of using them? In my opinion, here are a few things that come to my mind : PHPUnit is more integrated with other tools, like, for instance, Selenium (PHPUnit can use it to open true real browsers to test your site) phpUnderControl for continuous-integration PHPUnit works well with Xdebug , to generate code-coverage reports PHPUnit is more widely used ; which probably means more support But note I don't work with symfony, nor lime... Still, I've never heards anyone speak about it, except for those

Execute custom SQL in symfony

為{幸葍}努か 提交于 2019-12-03 16:34:48
I'm trying to execute some custom SQL to retrieve some model objects in a Symfony application. I found a tutorial on the web that said something like this would allow me to execute the query although not populate the models (populating the model isn't a major issue, it's just for read only data). $pdo = Doctrine_Manager::getInstance()->connection()->getDbh(); $pdo->prepare("SELECT * from something complicated"); $pdo->execute(); $this->sensorReadings = $pdo->fetchAll(); But I'm getting an error : Fatal error: Call to undefined method PDO::execute() in sfproject/apps/frontend/modules/site