[symfony-users] Re: How can i use a symfony helper in a js file
A thing that you might do is to have a Javascript module in wich you could render the needed Js functions. Ofcourse, this is not recomended... On Thu, Apr 16, 2009 at 7:45 PM, Richtermeister nex...@gmail.com wrote: Hey Ahmed, look into sfContext::getInstance()-getController()-genUrl ($internal_uri, $absolute); to generate the url. That's what's being called from within the url_for function, and it's perfectly fine to use that within your app code. Hope this helps, Daniel On Apr 16, 4:26 am, Ahmed ghaliano2...@gmail.com wrote: Hi paolo ; I have already done this before but my goal is to separate the all my Javascript from templates and use helper in this file . Best regards Ahmed permuter On 16 avr, 13:09, Paolo Mainardi paolomaina...@gmail.com wrote: Embed this code in a file template and will work :) On Thu, Apr 16, 2009 at 1:08 PM, Ahmed ghaliano2...@gmail.com wrote: Hi all :) , I want to use a php function to generate url ( for ajax call) in a js file like this : ?php Header(content-type: application/x-javascript); ? $(document).ready(function(){ $.ajax({ url: ?php echo url_for('company/step1')?, success: function(html){ $(#step1_container).append(html); } }); }) ; But in the generated code i have a logic error $(document).ready(function(){ 2 $.ajax({ 3 url: br / 4bFatal error/b: Call to undefined function url_for() in b \www\web\js\company\home.js.php/b on line b4/bbr / How can i resolve this please ? [Updated on: Thu, 16 April 2009 12:39] -- Paolo Mainardi CTO Twinbit Blog:http://www.paolomainardi.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Using ajax for input text update
You can use a normal template to be rendered after an ajax call, just set hasLayout to false either in view.yml, or in your action. I think symfony can do this automatically when the IsXMLHTTPRequest http header is set (automatically done by prototype and jquery). On Thu, Apr 16, 2009 at 16:09, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote: Thank you, now I know how exactly return data :) with renderText or renderPartial :) Main problem was that remote_function could update only elements like DIVs, not values of input. I thought that this is how it working. But no one wrote enywhere that you can ommit update and use success with data. There I put jQuery function that updates value of an input. 2009/4/16 Steve the Canuck steve.san...@gmail.com There are a few ways to do ajax based rendering. One way is to have the Ajax based action you are calling return you the chunk of HTML and then you just render that HTML. Another way is for the Ajax based action to return you a response (more appropriate if there are multiple pieces of data and you may want to render the data in various structures in the HTML document. Which method you go with depends on which jquery method you call. Take a look here: http://www.symfony-project.org/jobeet/1_2/Propel/en/18 On Apr 16, 6:37 am, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote: So maybe any guess how to get data from action via ajax and put it into input? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Using ajax for input text update
OK :) Yes, it is done automatically while using IsXMLHTTPRequest 2009/4/17 FÁSI Gábor maerl...@gmail.com You can use a normal template to be rendered after an ajax call, just set hasLayout to false either in view.yml, or in your action. I think symfony can do this automatically when the IsXMLHTTPRequest http header is set (automatically done by prototype and jquery). On Thu, Apr 16, 2009 at 16:09, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote: Thank you, now I know how exactly return data :) with renderText or renderPartial :) Main problem was that remote_function could update only elements like DIVs, not values of input. I thought that this is how it working. But no one wrote enywhere that you can ommit update and use success with data. There I put jQuery function that updates value of an input. 2009/4/16 Steve the Canuck steve.san...@gmail.com There are a few ways to do ajax based rendering. One way is to have the Ajax based action you are calling return you the chunk of HTML and then you just render that HTML. Another way is for the Ajax based action to return you a response (more appropriate if there are multiple pieces of data and you may want to render the data in various structures in the HTML document. Which method you go with depends on which jquery method you call. Take a look here: http://www.symfony-project.org/jobeet/1_2/Propel/en/18 On Apr 16, 6:37 am, Tomasz Ignatiuk tomek.ignat...@gmail.com wrote: So maybe any guess how to get data from action via ajax and put it into input? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Multiple actions, one template?
As you've got the same template for all your module's actions, I'd include $this-setTemplate('my'); in the preExecute method... On 16 avr, 19:54, Kevin Barsotti kevin.barso...@tribaldawn.com wrote: Thank you, that's exactly what I was looking for! Dheeraj Kumar Aggarwal wrote: hi you can do this by using $this-setTemplate('my'); in actions class On Thu, Apr 16, 2009 at 11:18 PM, Kevin Barsotti kevin.barso...@tribaldawn.com mailto:kevin.barso...@tribaldawn.com wrote: I'm working on making an existing module more efficient, and presently it has numerous (dozens) of actions which call upon an equal number of templates that are for all intents and purposes identical, but with differing data, i.e. executeA()- aSuccess.php executeB()- bSuccess.php executeC()- cSuccess.php etc... Ideally I'd like to just use a single template, let's call it mySuccess.php, for numerous actions of this module (but not all of them!). What would you recommend as the best way to handle this? -- Kevin Barsotti Operations Director Tribal Dawn, LLC www.tribaldawn.comhttp://www.tribaldawn.com 412.736.1357 -- Regards, Dheeraj -- Kevin Barsotti Operations Director Tribal Dawn, LLC www.tribaldawn.com 412.736.1357 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] batch script+send email+paramater
Hi, how we can send email in a batch process using sendEmail method and how we can pass parameter from batch file to mail action. Thanks, Kusum --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Form doesn't save files
Hi all, I made a non-Propel form, with several file inputs in it. But, now it doesn't save the files! This is my form.class.php: public function configure(){ $aHospitals = HospitalPeer::selectList(); foreach($aHospitals as $oHospital){ $this-widgetSchema['hospital' . $oHospital-getId()] = new sfWidgetFormInputFile(); $this-widgetSchema-setLabel('hospital' . $oHospital-getId(), $oHospital-getName()); $this-validatorSchema['hospital' . $oHospital-getId()] = new sfValidatorFile( array( 'path' = sfConfig::get('sf_upload_dir') . '/schedules', 'mime_types' = array('application/pdf') ), array( 'required' = 'Er is geen planning geselecteerd.', 'mime_types' = 'De planning heeft een verkeerde bestandsextensie (enkel PDF).', 'max_size' = 'De planning is te groot (maximaal %max_size% bytes).' ) ); } } As you can see, I create a file input widget for each object (hospital). I also create a validator which has to store the file. This is my actions.class.php: $oForm = new myScheduleForm(); if($oRequest-isMethod('post')){ $oForm-bind($oRequest-getParameter($oForm-getName()), $oRequest- getFiles($oForm-getName())); if($oForm-isValid()){ foreach($aHospitals as $oHospital){ $oSchedule = new Schedule(); $oSchedule-setHospitalId($oHospital-getId()); $oSchedule-setSchedule($oForm-getValue('hospital' . $oHospital- getId())); $oSchedule-save(); } $this-redirect('@dashboard'); } } Here I create a new object (database record) for each hospital. Does anyone know why the files are not being uploaded? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: London symfony users meeting! 17th April
Last reminder! meeting in Putney night! 2009/4/3 Ian P. Christian poo...@pookey.co.uk: Everyone remember, london meeting! http://www.meetup.com/symfony/calendar/10055154/ Blog: http://pookey.co.uk/blog Follow me on twitter: http://twitter.com/ipchristian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: symfony textmate bundle
Hi, first congratulation for this excellent bundle. I just want to ask you if it's possible to integrate Doctrine command in the future ? Thank you On 26 mar, 11:54, Dennis Benkert spinecras...@googlemail.com wrote: I just pushed the first preview of the bundle (codename 'conductor's baton') to github (http://github.com/denderello/symfony-tmbundle/tree/master). Everybody is invited to give feedback about the features, usage, etc. Happy coding, Dennis 2009/3/24 Dennis Benkert spinecras...@googlemail.com: FWIW, I've mapped getRequestParameter() to ^P to match the Rails bundle. It's such a common thing that it deserves to be easy to insert. Ideally, the bundle would detect sf = 1.1 and automatically use $request-getParameter() instead of $this- getRequest()-getParameter(). I try to add it without doubling the code. But if I create a github repository you can just send me a pull request. I'll see what I can do about the lookup of the projects symfony version. strg? is that command? Whoops. 'strg' is the german version of 'ctrl'. :) So it's 'ctrl' + 's' (or ^S) to open the cli menu. - Dennis 2009/3/24 Jacob Coby jc...@portallabs.com: On Mar 24, 2009, at 11:04 AM, Dennis Benkert wrote: Hey all, I just wanted to inform you about the state of the bundle. I did some refactoring on the tab shortcuts and they are much shorter now. To give you a little teaser I will list some of them: 'gro' + tab: will produce $this-getRoute()-getObject(); 'gp' + tab: will produce $this-getRequest()- getRequestParameter('id'); 'rgp' + tab: will produce $request-getParameter('id'); 'user' + tab: will produce $this-getUser() Nice. Much easier to invoke. FWIW, I've mapped getRequestParameter() to ^P to match the Rails bundle. It's such a common thing that it deserves to be easy to insert. Ideally, the bundle would detect sf = 1.1 and automatically use $request-getParameter() instead of $this- getRequest()-getParameter(). There are of course even more shortcuts for different parts of symfony (actions, models, views, forms, etc.). Maybe i can give you a full list of them after the next weekend. How about some command to run sf command line from within Textmate? I'm working on this already. My idea is to execute the common symfony tasks within textmate (e.g. symfony cc) and show the output as a nice html popup. As for now you can run 'cc', '-V', 'test:all', 'propel:build-all', 'propel:build-model' and 'propel:build-forms' via the key binding 'strg' + 's'. strg? is that command? Also, a larger task might be doing an autocomplete of model getter and setter functions. I'm not sure if textmate has the functionality to do that and i'm also not sure if textmate is the right editor for this feature. :) There is a php code completion bundle already available. I've never used it though. All in all, TM just doesn't seem to have very good support for code completion. To give you all access to my working copy I'm also thinking about putting the bundle on github. Are there any concerns about this? If you have any other suggestions (even for key bindings or tab shortcuts) feel free to post them here. Please do. I'll probably send a couple of pull requests your way. The other option is to try and get it into the macromates svn repository. I don't know the process for that though. - Dennis 2009/3/24 Gareth McCumskey gmccums...@gmail.com: On Mon, Mar 23, 2009 at 8:43 PM, hsteckylf j...@jncissler.com wrote: Also, a larger task might be doing an autocomplete of model getter and setter functions. You mean just like Eclipse PDT can already do? :P -- Jacob Coby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Doctrine UNION function or similar solution
Hi there, it takes a bit of doing and there's a bunch of gotchas but here's how I did it: In the appropriate doctrine class I did this: public function getByLastname($lastname) { $cnn = Doctrine_Manager::connection(); $quoted_lastname = $cnn-quote($lastname, 'string'); $people = $cnn-fetchAssoc( ( select first_name, last_name, name_slug from director where last_name like $quoted_lastname ) union all ( select first_name, last_name, name_slug from actor where last_name like $quoted_lastname ) ); return $people; } This will return an associative array of what you're looking for. Valk On Mar 25, 3:30 am, pixelmeister jumh...@googlemail.com wrote: Hi @all, i have to solve a problem with doctrine which I normally would do with the mysql union function. Perhaps someone has an Idea for me, how I can do this: I have a few tables whitch have the following setup: -- table name: director first_name: string last_name: string name_slug: string -- table name: actor first_name: string last_name: string name_slug: string -- ... and so on. The tables contain different persons related to movies. For example: directors, screenwriters, actors, cutters and so on. Now, for a new function, i need to select all persons from all tables where last name ist starting with (for Example) A%, sortetd by last_name. How would you do the doctrine query? Perhaps I have to select the perons table per table and merge them later in arrays... and then write a sort function for the arrays? But somehow I dont like this way ;-) Any suggestions would be grat. Thanks, Kai --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Schema Problem
i have installed symfony 1.2.5 on windows xp. and using mysql 5 and apache 2.0 and php 5.8 when i run this command get follwoing result. command: pear channel-discover pear.symfony-project.com result: D:\Apache2\htdocs\proj1symfony propel:build-schema PHP Fatal error: Class 'PDO' not found in D:\php5\PEAR\pear\symfony \plugins\sfP ropelPlugin\lib\vendor\propel\util\PropelPDO.php on line 42 Fatal error: Class 'PDO' not found in D:\php5\PEAR\pear\symfony\plugins \sfPropel Plugin\lib\vendor\propel\util\PropelPDO.php on line 42 D:\Apache2\htdocs\proj1 When i rung phpinfo(); it shows PDO extensions enabled. when i run php -m it does not shoe PDO extensions enabled for mysql. please if any one has any idea about the problem help me. Thanks Waseem --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: London symfony users meeting! 17th April
I'd have gone, but I'm not working in London at the mo, and I live north of the river... Maybe next time! On 17 Apr 2009, at 14:50, Ian P. Christian wrote: Last reminder! meeting in Putney night! 2009/4/3 Ian P. Christian poo...@pookey.co.uk: Everyone remember, london meeting! http://www.meetup.com/symfony/calendar/10055154/ Blog: http://pookey.co.uk/blog Follow me on twitter: http://twitter.com/ipchristian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: symfony textmate bundle
Sure! Can the Doctrine users maybe post some suggestions of snippets or commands? It would be exciting go get some response from 'hardcore' Doctrine users to find helpfull shortcuts. - Dennis 2009/4/17 MrMoins cmo...@gmail.com: Hi, first congratulation for this excellent bundle. I just want to ask you if it's possible to integrate Doctrine command in the future ? Thank you On 26 mar, 11:54, Dennis Benkert spinecras...@googlemail.com wrote: I just pushed the first preview of the bundle (codename 'conductor's baton') to github (http://github.com/denderello/symfony-tmbundle/tree/master). Everybody is invited to give feedback about the features, usage, etc. Happy coding, Dennis 2009/3/24 Dennis Benkert spinecras...@googlemail.com: FWIW, I've mapped getRequestParameter() to ^P to match the Rails bundle. It's such a common thing that it deserves to be easy to insert. Ideally, the bundle would detect sf = 1.1 and automatically use $request-getParameter() instead of $this- getRequest()-getParameter(). I try to add it without doubling the code. But if I create a github repository you can just send me a pull request. I'll see what I can do about the lookup of the projects symfony version. strg? is that command? Whoops. 'strg' is the german version of 'ctrl'. :) So it's 'ctrl' + 's' (or ^S) to open the cli menu. - Dennis 2009/3/24 Jacob Coby jc...@portallabs.com: On Mar 24, 2009, at 11:04 AM, Dennis Benkert wrote: Hey all, I just wanted to inform you about the state of the bundle. I did some refactoring on the tab shortcuts and they are much shorter now. To give you a little teaser I will list some of them: 'gro' + tab: will produce $this-getRoute()-getObject(); 'gp' + tab: will produce $this-getRequest()- getRequestParameter('id'); 'rgp' + tab: will produce $request-getParameter('id'); 'user' + tab: will produce $this-getUser() Nice. Much easier to invoke. FWIW, I've mapped getRequestParameter() to ^P to match the Rails bundle. It's such a common thing that it deserves to be easy to insert. Ideally, the bundle would detect sf = 1.1 and automatically use $request-getParameter() instead of $this- getRequest()-getParameter(). There are of course even more shortcuts for different parts of symfony (actions, models, views, forms, etc.). Maybe i can give you a full list of them after the next weekend. How about some command to run sf command line from within Textmate? I'm working on this already. My idea is to execute the common symfony tasks within textmate (e.g. symfony cc) and show the output as a nice html popup. As for now you can run 'cc', '-V', 'test:all', 'propel:build-all', 'propel:build-model' and 'propel:build-forms' via the key binding 'strg' + 's'. strg? is that command? Also, a larger task might be doing an autocomplete of model getter and setter functions. I'm not sure if textmate has the functionality to do that and i'm also not sure if textmate is the right editor for this feature. :) There is a php code completion bundle already available. I've never used it though. All in all, TM just doesn't seem to have very good support for code completion. To give you all access to my working copy I'm also thinking about putting the bundle on github. Are there any concerns about this? If you have any other suggestions (even for key bindings or tab shortcuts) feel free to post them here. Please do. I'll probably send a couple of pull requests your way. The other option is to try and get it into the macromates svn repository. I don't know the process for that though. - Dennis 2009/3/24 Gareth McCumskey gmccums...@gmail.com: On Mon, Mar 23, 2009 at 8:43 PM, hsteckylf j...@jncissler.com wrote: Also, a larger task might be doing an autocomplete of model getter and setter functions. You mean just like Eclipse PDT can already do? :P -- Jacob Coby --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: how to prevent symfony to add css/js automatically?
In view.yml, you can either remove them specifically indexSuccess: stylesheets: [-main] or all at once : indexSuccess: stylesheets: [-*] javascripts: [-*] This is for Symfony 1.0, I have no idea if things changed in 1.1 or 1.2 More on this at http://www.symfony-project.org/book/1_0/07-Inside-the-View-Layer#View%20Configuration On Apr 8, 11:54 am, xhe hexuf...@gmail.com wrote: I have set a template layout to be off, but in the real template, if I add head tag, all the default css and javascript are added automatically. I tested it a lot, and found whenever Sym meet /head tag, it will automatically add default css/js file no matter if you set layout to be off or on. If I left the template without head tag, the page is good, but that is not CSS validated. So are anyway to prevent sym from adding css/js automatically? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Schema Problem
The cli often has a different php.ini, maybe you don't have pdo enabled there. Run a phpinfo() from the command line and it will tell you which php.ini it uses. On Fri, Apr 17, 2009 at 12:40, Waseem whme...@gmail.com wrote: i have installed symfony 1.2.5 on windows xp. and using mysql 5 and apache 2.0 and php 5.8 when i run this command get follwoing result. command: pear channel-discover pear.symfony-project.com result: D:\Apache2\htdocs\proj1symfony propel:build-schema PHP Fatal error: Class 'PDO' not found in D:\php5\PEAR\pear\symfony \plugins\sfP ropelPlugin\lib\vendor\propel\util\PropelPDO.php on line 42 Fatal error: Class 'PDO' not found in D:\php5\PEAR\pear\symfony\plugins \sfPropel Plugin\lib\vendor\propel\util\PropelPDO.php on line 42 D:\Apache2\htdocs\proj1 When i rung phpinfo(); it shows PDO extensions enabled. when i run php -m it does not shoe PDO extensions enabled for mysql. please if any one has any idea about the problem help me. Thanks Waseem --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Fast symfony API searches using Mozilla's Ubiquity extension
Hey Eno, that is really really cool :) Thanks for introducing that and sharing the code. Daniel On Apr 16, 12:05 pm, Eno symb...@gmail.com wrote: Here's a quick hack to add a 'symfony' command to Ubiquity which allows you to quickly do a search of the symfony API docs. With Ubiquity installed in Firefox, go to:http://gist.github.com/94237and Subscribe to the command when prompted. (And if you've never seen Ubiquity and don't know what it is, watch the video here:http://labs.mozilla.com/2008/08/introducing-ubiquity/) Enjoy :-) -- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Many sites using the same application
Hey Nei, this is so weird, I will be starting a project this weekend that seems to have the same goal / structure. A CMS for multiple websites.. If you like I'd be interested in emailing you directly so we can share some ideas and figure out how to best build this using symfony. Daniel On Apr 16, 8:34 am, Nei Rauni Santos nra...@gmail.com wrote: I have a similar structure actually.. about the Directory Index I'm using too! Have you already created this kind of structure with just one document_root? Thanks, Nei On Apr 16, 4:33 am, Alexandru-Emil Lupu gang.al...@gmail.com wrote: instead of using ln -s, you might wanna do something like in your apache config: server 2: Alias /css /home/example1/site/web/css Alias /js /home/example1/site/web/js server 3: Alias /css /home/example1/site/web/css Alias /js /home/example1/site/web/js 2) also ... if your websites are just mirrors why don't you make an alias and have just one big vhost 3) if your websites uses different applications of the same project, then you could change the directory index directive in the vhost config and set it to point to a different page. Ex: all doc roots are pointing in the same location, but the Directory Index points out one for index.php (the default) , second for app2.php and 3rd for app3.php.. Do not use symlinks in your application. (except maybe for cache log dir if you use capistrano or so for deplyement) If you have the same frontend, then relax.. if one fails, all will do. :) alecs On Thu, Apr 16, 2009 at 1:13 AM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: Create a symbolic link on your server? Search Google for the command ln -s! On 16 apr, 00:03, Nei Rauni Santos nra...@gmail.com wrote: Hi guys, Anyone here already created a Symfony's project where the frontend application is shared by many websites?? I would be happy if you could share this experience with me. I need to recreate an application like this and I'm thinking to do this in the following way: - I already has a table called cms.sites.. table: cms.sites columns: id, name, url, css, js, created_at, updated_at my frontend: - an application frontend - a module home I have a filter where it gets the url of request and consult the table sites to get info about it, like js, css my server: www.example1.com.br server: host.test.com document_root: /home/example1/site www.example2.com.br server: host.test.com document_root: /home/example2/site www.example3.com.br server: host.test.com document_root: /home/example3/site some details: - some directories like js, images and css have a symbolic link to the same centralized directory. - I have an other application called admin installed in another place where I use it to manage the database and to configure the frontends. Some doubts are: - How is the better way to structure the project? - Is it better to configure each domain with its own document_root or to point all domains to the same document_root? some domains has more traffic than others. So, I need that to work fine because if one fail all them will also fail. Regards, Nei Rauni Santoshttp://blog.inuar.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How can i use a symfony helper in a js file
Thanks for all; After many search i found that the best way is doing this with helper . @Alexandru-Emil Lupu : Why it's not recomended ? On 17 avr, 08:50, Alexandru-Emil Lupu gang.al...@gmail.com wrote: A thing that you might do is to have a Javascript module in wich you could render the needed Js functions. Ofcourse, this is not recomended... On Thu, Apr 16, 2009 at 7:45 PM, Richtermeister nex...@gmail.com wrote: Hey Ahmed, look into sfContext::getInstance()-getController()-genUrl ($internal_uri, $absolute); to generate the url. That's what's being called from within the url_for function, and it's perfectly fine to use that within your app code. Hope this helps, Daniel On Apr 16, 4:26 am, Ahmed ghaliano2...@gmail.com wrote: Hi paolo ; I have already done this before but my goal is to separate the all my Javascript from templates and use helper in this file . Best regards Ahmed permuter On 16 avr, 13:09, Paolo Mainardi paolomaina...@gmail.com wrote: Embed this code in a file template and will work :) On Thu, Apr 16, 2009 at 1:08 PM, Ahmed ghaliano2...@gmail.com wrote: Hi all :) , I want to use a php function to generate url ( for ajax call) in a js file like this : ?php Header(content-type: application/x-javascript); ? $(document).ready(function(){ $.ajax({ url: ?php echo url_for('company/step1')?, success: function(html){ $(#step1_container).append(html); } }); }) ; But in the generated code i have a logic error $(document).ready(function(){ 2 $.ajax({ 3 url: br / 4bFatal error/b: Call to undefined function url_for() in b \www\web\js\company\home.js.php/b on line b4/bbr / How can i resolve this please ? [Updated on: Thu, 16 April 2009 12:39] -- Paolo Mainardi CTO Twinbit Blog:http://www.paolomainardi.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: How can i use a symfony helper in a js file
I've used modules and actions to serve dynamic js files all the time. Just make sure you turn on caching if you can and make sure the right headers are sent for js files so that they are cached in the users browser. - Jon On Fri, Apr 17, 2009 at 1:13 PM, Ahmed ghaliano2...@gmail.com wrote: Thanks for all; After many search i found that the best way is doing this with helper . @Alexandru-Emil Lupu : Why it's not recomended ? On 17 avr, 08:50, Alexandru-Emil Lupu gang.al...@gmail.com wrote: A thing that you might do is to have a Javascript module in wich you could render the needed Js functions. Ofcourse, this is not recomended... On Thu, Apr 16, 2009 at 7:45 PM, Richtermeister nex...@gmail.com wrote: Hey Ahmed, look into sfContext::getInstance()-getController()-genUrl ($internal_uri, $absolute); to generate the url. That's what's being called from within the url_for function, and it's perfectly fine to use that within your app code. Hope this helps, Daniel On Apr 16, 4:26 am, Ahmed ghaliano2...@gmail.com wrote: Hi paolo ; I have already done this before but my goal is to separate the all my Javascript from templates and use helper in this file . Best regards Ahmed permuter On 16 avr, 13:09, Paolo Mainardi paolomaina...@gmail.com wrote: Embed this code in a file template and will work :) On Thu, Apr 16, 2009 at 1:08 PM, Ahmed ghaliano2...@gmail.com wrote: Hi all :) , I want to use a php function to generate url ( for ajax call) in a js file like this : ?php Header(content-type: application/x-javascript); ? $(document).ready(function(){ $.ajax({ url: ?php echo url_for('company/step1')?, success: function(html){ $(#step1_container).append(html); } }); }) ; But in the generated code i have a logic error $(document).ready(function(){ 2 $.ajax({ 3 url: br / 4bFatal error/b: Call to undefined function url_for() in b \www\web\js\company\home.js.php/b on line b4/bbr / How can i resolve this please ? [Updated on: Thu, 16 April 2009 12:39] -- Paolo Mainardi CTO Twinbit Blog:http://www.paolomainardi.com -- Jonathan H. Wage Open Source Software Developer Evangelist http://www.jwage.com http://www.doctrine-project.org http://www.symfony-project.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] my custom handler isn't autoloading
I'm trying to write a custom handles based in this page Adding Your Own Handler) on http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files my codes is here: http://pastebin.com/d7f7d1cfe. I wrote all passes but it isn't loading.. Is needed to do others things?? Thanks, Nei --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: my custom handler isn't autoloading
the paths are wrong.. this is ok http://pastebin.com/m47f52810 all files are under frontend app directory.. Thanks On Apr 17, 4:39 pm, Nei Rauni Santos nra...@gmail.com wrote: I'm trying to write a custom handles based in this page Adding Your Own Handler) onhttp://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Config... my codes is here:http://pastebin.com/d7f7d1cfe. I wrote all passes but it isn't loading.. Is needed to do others things?? Thanks, Nei --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: my custom handler isn't autoloading
It work now.. The problem is that in the manual ins't write to create a file called config.php here the page where I found the best explanation. http://trac.symfony-project.org/wiki/HowToHandleCrossAppsConfigurationFiles the documentation need to be updated. Nei On Apr 17, 4:42 pm, Nei Rauni Santos nra...@gmail.com wrote: the paths are wrong.. this is okhttp://pastebin.com/m47f52810 all files are under frontend app directory.. Thanks On Apr 17, 4:39 pm, Nei Rauni Santos nra...@gmail.com wrote: I'm trying to write a custom handles based in this page Adding Your Own Handler) onhttp://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Config... my codes is here:http://pastebin.com/d7f7d1cfe. I wrote all passes but it isn't loading.. Is needed to do others things?? Thanks, Nei --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Many sites using the same application
I run three or for different set ups where the sites share common code, but the look and feel is different to some extent. each of the two examples below run about 12 differnet sites, with varying degrees of shared content - i wont post all the ULR's or it will look like i'm link spamming, but a couple of instances are http://savewatersavemoney.co.uk http://st.savewatersavemoney.co.uk http://awdirect.savewatersavemoney.co.uk (these all share a common domain, and have different branding based on the subdomain, as you will see, the first two are very similar - the last is very different. a seperare set up is. http://www.northwestitjobs.co.uk http://www.southeastitjobs.co.uk these are very similar - but have different domain names, i have a couple of other requirements, in that its possible to add new domains on the fly, so i store my site data in a db table - you dont have to, its just easier for the way i need to do things. the example below is for symfony 1.0, and im doing this from memory, so i dont have al the details to hand, but its enough to get started - i can provide more details tomorow if you wanrt though. so a table, called site. id, site_name url_map. branding_folder site_title etc etc each of my actions has a preExecute method like so. (though if i was re writing i'd probably use a filter i guess) public function preExecute() { siteBranding::getSiteBrandingDetails($this); } the method matches the current request url to the url_map column, if it finds a match it changes the template to be a customised one. $site = SitePeer::retrieveByURL($_SERVER['HTTP_HOST']); // basically just does a simple SitePeer::doSelectOne() if($site){ $action-site=$site; // $action is the $this we passed in above, sfContext::getInstance()-getResponse()-setTitle($action-site- getSiteName()); sfContext::getInstance()-getUser()-setAttribute(current_site, $site); // i store this in the session so that i dont have to do the look up every time - if the value is set, it just returns the existing site. $action-setLayout(sfConfig::get('sf_web_dir').$site- getBrandingFolder()./layout ); }else{ $action-setLayout( sfConfig::get('sf_web_dir'). /branding/sites/generic/layout); } sorry thats all a bit messy, but as i say - shout if you want to see the proper code (or feel free to post about why my method of doing it sucks - always happy to see other view points ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Many sites using the same application
There is a plugin called ysfDimension. You might want to look at that. 2009/4/17 Derek Almond iamde...@gmail.com I run three or for different set ups where the sites share common code, but the look and feel is different to some extent. each of the two examples below run about 12 differnet sites, with varying degrees of shared content - i wont post all the ULR's or it will look like i'm link spamming, but a couple of instances are http://savewatersavemoney.co.uk http://st.savewatersavemoney.co.uk http://awdirect.savewatersavemoney.co.uk (these all share a common domain, and have different branding based on the subdomain, as you will see, the first two are very similar - the last is very different. a seperare set up is. http://www.northwestitjobs.co.uk http://www.southeastitjobs.co.uk these are very similar - but have different domain names, i have a couple of other requirements, in that its possible to add new domains on the fly, so i store my site data in a db table - you dont have to, its just easier for the way i need to do things. the example below is for symfony 1.0, and im doing this from memory, so i dont have al the details to hand, but its enough to get started - i can provide more details tomorow if you wanrt though. so a table, called site. id, site_name url_map. branding_folder site_title etc etc each of my actions has a preExecute method like so. (though if i was re writing i'd probably use a filter i guess) public function preExecute() { siteBranding::getSiteBrandingDetails($this); } the method matches the current request url to the url_map column, if it finds a match it changes the template to be a customised one. $site = SitePeer::retrieveByURL($_SERVER['HTTP_HOST']); // basically just does a simple SitePeer::doSelectOne() if($site){ $action-site=$site; // $action is the $this we passed in above, sfContext::getInstance()-getResponse()-setTitle($action-site- getSiteName()); sfContext::getInstance()-getUser()-setAttribute(current_site, $site); // i store this in the session so that i dont have to do the look up every time - if the value is set, it just returns the existing site. $action-setLayout(sfConfig::get('sf_web_dir').$site- getBrandingFolder()./layout ); }else{ $action-setLayout( sfConfig::get('sf_web_dir'). /branding/sites/generic/layout); } sorry thats all a bit messy, but as i say - shout if you want to see the proper code (or feel free to post about why my method of doing it sucks - always happy to see other view points ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] changing the default signin form's layout in sfGuardAuth
I want to change the layout of the default signin form in sfGuardAuth. How do I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: changing the default signin form's layout in sfGuardAuth
Set the layout declaration in your custom template (in Your sfGuard Module) to whatever you want.i.e ?php decorate_with('sfGuard_layout') ? 2009/4/18 ckemmler ckemm...@gmail.com I want to change the layout of the default signin form in sfGuardAuth. How do I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: changing the default signin form's layout in sfGuardAuth
I mean: just the form, not the layout of the entire page On Apr 17, 6:27 pm, Eran eran...@gmail.com wrote: Set the layout declaration in your custom template (in Your sfGuard Module) to whatever you want.i.e ?php decorate_with('sfGuard_layout') ? 2009/4/18 ckemmler ckemm...@gmail.com I want to change the layout of the default signin form in sfGuardAuth. How do I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Many sites using the same application
Derek Almond wrote: I run three or for different set ups where the sites share common code, but the look and feel is different to some extent. each of the two examples below run about 12 differnet sites, with varying degrees of shared content - i wont post all the ULR's or it will look like i'm link spamming, but a couple of instances are http://savewatersavemoney.co.uk http://st.savewatersavemoney.co.uk This one gets me a white page with It works!... Just FYI -- Nathanael d. Noblet T: 403.875.4613 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: changing the default signin form's layout in sfGuardAuth
ckemmler wrote: I mean: just the form, not the layout of the entire page Create a module in your application with the same name as the module in the plugin, then create a templates folder, with a template for that action. -- Nathanael d. Noblet T: 403.875.4613 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: changing the default signin form's layout in sfGuardAuth
I did that. But the problem I have is that the forms are dynamic, i.e. they can include error messages for example. Thus, what I need is a formatter. The documentation seems to be incomplete in that regard. It speaks of setting a form formatter (I tried the list one, but it didn't work) and also that it's going to explain more about custom formatting a form in Chapter 5, which doesn't exist! You can see what I did at http://www.twittbook.com (the signin form), but it's broken, as it is (it just resets the form in case of an error). On Apr 17, 7:33 pm, Nathanael D. Noblet nathan...@gnat.ca wrote: ckemmler wrote: I mean: just the form, not the layout of the entire page Create a module in your application with the same name as the module in the plugin, then create a templates folder, with a template for that action. -- Nathanael d. Noblet T: 403.875.4613 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---