[symfony-users] Re: About embed forms
I tried it with $opinion = new Opinion(); $opfeat = new $opinion-OpinionFeature; but cant find the class OpinionFeature... Otherwise i do the same you write (more or less). I think that when i'm showing opinion form it creates a new Opinion(); variable. Then i use that variable to set the new OpinionFeature var... $opfeat-setOpinionId($this-getObject()-id); $opfeat-setFeatureId($feature-getId()); $OFform = new OpinionFeatureForm($opfeat); $this-embedForm('feature_'.$feature-getId(), $OFform); But it doesnt work... i have to overwrite saveEmbedForms public function saveEmbeddedForms($con = null, $forms = null) { foreach($this-getEmbeddedForms() as $opinionForm) { $opinionForm-getObject()-setOpinionId($this-getObject()-getId()); } parent::saveEmbeddedForms($con, $forms); } I think there's a easier way to do this but.. i dont know. :( 2009/10/6 Dennis gear...@sbcglobal.net I got this off of a Fabien post, somewhere. If you look at it, it makes everything connect to the same parent record. It SHOULD save correctly. I am goin to try it in my project tonight. Let me know if it works for you. $user = new User(); $profile = new $user-Profile; $userForm = new UserForm($user); $profileForm = new ProfileForm($profile); $userForm-embedForm('Profile', $profileForm); On Oct 5, 2:13 am, elkrema elfra...@gmail.com wrote: Hi Dennis, there is my schema: Feature: tableName: feature columns: id: type: integer(8) primary: true autoincrement: true name: type: string(255) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: OpinionFeature: local: id foreign: feature_id type: many Opinion: tableName: opinion columns: id: type: integer(8) primary: true autoincrement: true title: type: string(255) notnull: true opiniontxt: type: string(2147483647) notnull: true is_active: type: integer(1) default: '0' notnull: true token: type: string(255) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: OpinionFeature: local: id foreign: opinion_id type: many OpinionFeature: tableName: opinion_feature columns: opinion_id: type: integer(8) primary: true feature_id: type: integer(8) primary: true score: type: float(2147483647) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: Opinion: local: opinion_id foreign: id type: one Feature: local: feature_id foreign: id type: one Its very similar to your schema. Mine havent got foreign_type but i think it works same yours... no? I did that with mysql workbench and then build schema... :) I think the problem was save embed forms i have to overwrite the saveEmbedForms function to set the opinionid of the OpinionFeature just at the moment of insert the opinion. Doing that it works, but i dont know if its the right way. Thank you very much. On 5 oct, 05:10, Dennis gear...@sbcglobal.net wrote: So what you have is a: Opinion--1-to-many --OpinionFeature--many-to-1--Feature (above is a good way to show a schema) So you have to set up your schema to reflect that: Keep in mind that you have to create the Parents, before creating the children. Parents HAVE an ID, Children are GIVEN or USE and ID. Parents are 'Opinion' and 'Feature'. Opinion: tableName: opinion columns: opinion_id: type: integer(8) primary: true sequence: opinion_opinion_id opinion_name: type: string(65) notnull: true relations: OpinionFeature: local: opinion_id foreign: opinion_id type: many foreignType: one Feature: tableName: feature columns: feature_id: type: integer(8) primary: true sequence: feature_feature_id feature_name: type: string(32) notnull: true feature_desc: type: string(128) notnull: true relations: OpinionFeature: local: feature_id foreign: feature_id type: many foreignType: one OpinionFeature: tableName: opinionfeature columns: opinion_id: type: integer(8) primary: true feature_id: type: integer(8) primary: true score: type: integer(2) notnull: true relations: Opinion: local: opinion_id foreign: opinion_id type: one foreignType: many Feature: local: feature_id
[symfony-users] Re: Raising events in a form
Hi ! What I always see is not to use sfContext directly in model, but : sfProjectConfiguration::getActive()-getEventDispatcher()-notify(new sfEvent($this, 'foo.bar')); ( as you already said ) An other solution is to inject your dispatcher like this : //in your form class: public function setEventDispatcher(sfEventDispatcher $dispatcher) { $this-eventDispatcher = $dispatcher; } // then in your action (or whatever else ): $form = new myForm; $form-setEventDispatcher($this-dispatcher); But if it doesn't work with the first solution, it surely won't with this one. Hope it helps ! Florian. On Oct 5, 10:37 am, rich_81 rich.s...@gmail.com wrote: Hi all, Hope you can help with this - it's got me stumped! Using Symfony 1.2.9, I have a situation where I'm raising an event via the dispatcher, during the saving of a form - I have multiple embedded forms which need to raise the event upon each individual form's saving. I'm seeing this currently in a unit test for the form. I have added my event method in the project configuration as normal, using: $this-dispatcher-connect(transaction.add, array (TransactionManager, sendAllocationEmail)); and I'm then raising the event in my form class using: sfContext::getInstance()-getEventDispatcher()-notify(new sfEvent (null, transaction.add, array())); (I've tried sfProjectConfiguration::getActive()-getEventDispatcher() as well) The problem is that the event is getting raised 4 times, no matter where in the form class I use this. I've tried moving it to the configure() method, I've tried removing all the embedded forms, and still my method is being called 4 times. The strange thing is, if I do: sfContext::getInstance()-getEventDispatcher()-notify(new sfEvent (null, application.log, array(About to raise my event))); sfContext::getInstance()-getEventDispatcher()-notify(new sfEvent (null, transaction.add, array())); sfContext::getInstance()-getEventDispatcher()-notify(new sfEvent (null, application.log, array(Raised my event))); in my log, I get the following: Oct 05 09:29:35 symfony [info] {main} About to raise my event Oct 05 09:29:35 symfony [info] {main} In my event's method Oct 05 09:29:35 symfony [info] {main} In my event's method Oct 05 09:29:35 symfony [info] {main} In my event's method Oct 05 09:29:35 symfony [info] {main} In my event's method Oct 05 09:29:35 symfony [info] {main} Raised my event The only code I have in my event handler at the moment is the application.log call. Has anybody else come across this at all? Is there a better way to retrieve the event dispatcher in the form, apart from upgrading to Symfony 1.3? :-) Thanks in advance, Rich. --~--~-~--~~~---~--~~ 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: Template in AJAX request
Just to add, using AJAX to do a full page load is not an ideal situation. AJAX is meant to be used for small parts of a page so that you don't have to relaod the whole page. If your AJAX is supposed to return the entire page rather do a page reload as this is actually faster to process as well than an AJAX call and is less likely to cause issues. On Mon, Oct 5, 2009 at 4:12 PM, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com wrote: If I make an AJAX call, Symfony doesn't take the whole templates/ layout.php with it, only the indexSuccess.php. Is there a way to tell that also the layout has to be shown? I want a total AJAX refresh of the complete HTML. -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc --~--~-~--~~~---~--~~ 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: sf1.0: Foreign Key oddities when dealing with a through-class and the Symfony Admin Generator
On Oct 5, 4:43 pm, benlancaster ben.lancas...@holler.co.uk wrote: When the Article is saved, the ArticlePage choices from the admin_check_list get saved, but the featured flag doesn't. What's REALLY weird is that my DB Query Log shows that the items are being saved with the correct 'featured' flag, but they're then being deleted, and re-inserted without the featured flag! I don't geddit. Any idea where I should start looking? I haven't overloaded any of the Article or ArticlePage's (do)Save methods - bit weird, huh? Answering my own question here, but I needed to overload the action's saveArticle method to include the featured flag. --~--~-~--~~~---~--~~ 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: sfGrid with Doctrine and a join how to get a field from a joint table
Hi Iwan, Sorry for the late reply, I only saw this post now. Unfortunately, this functionality is currently not supported by the Doctrine driver. Bernhard -- Software Architect Engineer Blog: http://webmozarts.com 2009/9/23 Iwan van Staveren istave...@gmail.com: I have two tables. And when iterating with the sfGrid over the main table that is fine. But I am unable to select a field from the joint table. What is the right syntax to use in the array given to grid-setColumns to select the fields from the joint table? Kind regards, --~--~-~--~~~---~--~~ 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] How to translate symfony plugins?
I use i18n ready plugins like sfGuard, sfApply, but i need them to speak different language than english. I foud out that i can translate them as usual with messages.xml file. The problem is how to extract all messages from plugin? Task i18n:extract does the job only for application's modules. Is such task not implemented for plugins yet? How coul'd be that possible? I asked same thing in forum, but got no respone. --~--~-~--~~~---~--~~ 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: Template in AJAX request
AJAX is not meant to resfresh the whole page. I think you should think about another way to do what u want. The only way i see to refresh the layout is to replace the content of the body tag --~--~-~--~~~---~--~~ 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] Sf/Doctrine : Using package option in schema file.
I've created the /config/doctrine/webservices.schema.yml : -- connection: webservices actAs: [Timestampable] options: type: INNODB User: package: lib.model.webservices columns: id: type: integer(4) primary: true autoincrement: true country_id: integer(4) password: string(255) relations: Country: foreignType: one onDelete: restrict onUpdate: cascade Country: package: lib.model.webservices columns: id: type: integer(4) primary: true autoincrement: true -- Here's command lauched : $ ./symfony doctrine:build-model doctrine generating model classes autoload Reloading autoloaders $ ls -l lib/model/ total 4 drwxr-xr-x 3 david david 4096 2009-10-06 11:31 doctrine (I don't have any webservices directory) Classes are generated in two places : $ ls -l lib/model/doctrine/lib/ total 20 drwxr-xr-x 2 david david 4096 2009-10-06 11:44 base -rw-r--r-- 1 david david 306 2009-10-06 11:44 Country.class.php -rw-r--r-- 1 david david 64 2009-10-06 11:44 CountryTable.class.php -rw-r--r-- 1 david david 297 2009-10-06 11:44 User.class.php -rw-r--r-- 1 david david 58 2009-10-06 11:44 UserTable.class.php $ ls -l plugins/lib/model/webservices/ total 16 -rw-r--r-- 1 david david 325 2009-10-06 11:44 PluginCountry.class.php -rw-r--r-- 1 david david 66 2009-10-06 11:44 PluginCountryTable.class.php -rw-r--r-- 1 david david 316 2009-10-06 11:44 PluginUser.class.php -rw-r--r-- 1 david david 63 2009-10-06 11:44 PluginUserTable.class.php I want class in lib/model/[doctrine/]webservices. How can I do that ? Thanks for your support. David. --~--~-~--~~~---~--~~ 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 translate symfony plugins?
Hi! I am not aware of such plugin developed yet, but i wanted to start one. Unfortunatelly i do not have the time to do it. Regards Alecs On Tue, Oct 6, 2009 at 1:43 PM, Lubiluk lubi...@gmail.com wrote: I use i18n ready plugins like sfGuard, sfApply, but i need them to speak different language than english. I foud out that i can translate them as usual with messages.xml file. The problem is how to extract all messages from plugin? Task i18n:extract does the job only for application's modules. Is such task not implemented for plugins yet? How coul'd be that possible? I asked same thing in forum, but got no respone. -- As programmers create bigger better idiot proof programs, so the universe creates bigger better idiots! I am on web: http://www.alecslupu.ro/ I am on twitter: http://twitter.com/alecslupu I am on linkedIn: http://www.linkedin.com/in/alecslupu Tel: (+4)0748.543.798 --~--~-~--~~~---~--~~ 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: sfWidgetFormSchemaFormatter granularity
++ Sometimes echo $form really could be more than just a convenience in the early stages of development, greatly accelerating the final product if only we had a reasonable hope of giving row containers class names and so on. The form decoration setup really is needlessly limiting. On Oct 5, 4:15 pm, wiredcs wire...@gmail.com wrote: Also... thinking more into the situation. It would be interesting to see a way to also implement wrapping input tags with the label thus removing the need for the for= attribute. ie: label class='this-field'input ../label On Oct 5, 3:12 pm, wiredcs wire...@gmail.com wrote: Is there any way to do more granular things than mentioned here:http://www.thatsquality.com/articles/7-days-of-symfony-1-1-forms-widg... For instance, I would like to add an id to the embedded form. Something like: $decoratorFormat = div id='%embedded_form_id%'%content%/div; --~--~-~--~~~---~--~~ 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: Sf/Doctrine : Using package option in schema file.
The model generation does not work this way and the package feature cannot be used with symfony. The package feature is how we generate models for plugins in symfony. - Jon On Tue, Oct 6, 2009 at 4:46 AM, David BOUCHÉ da...@bouchethomas.com wrote: I've created the /config/doctrine/webservices.schema.yml : -- connection: webservices actAs: [Timestampable] options: type: INNODB User: package: lib.model.webservices columns: id: type: integer(4) primary: true autoincrement: true country_id: integer(4) password: string(255) relations: Country: foreignType: one onDelete: restrict onUpdate: cascade Country: package: lib.model.webservices columns: id: type: integer(4) primary: true autoincrement: true -- Here's command lauched : $ ./symfony doctrine:build-model doctrine generating model classes autoload Reloading autoloaders $ ls -l lib/model/ total 4 drwxr-xr-x 3 david david 4096 2009-10-06 11:31 doctrine (I don't have any webservices directory) Classes are generated in two places : $ ls -l lib/model/doctrine/lib/ total 20 drwxr-xr-x 2 david david 4096 2009-10-06 11:44 base -rw-r--r-- 1 david david 306 2009-10-06 11:44 Country.class.php -rw-r--r-- 1 david david 64 2009-10-06 11:44 CountryTable.class.php -rw-r--r-- 1 david david 297 2009-10-06 11:44 User.class.php -rw-r--r-- 1 david david 58 2009-10-06 11:44 UserTable.class.php $ ls -l plugins/lib/model/webservices/ total 16 -rw-r--r-- 1 david david 325 2009-10-06 11:44 PluginCountry.class.php -rw-r--r-- 1 david david 66 2009-10-06 11:44 PluginCountryTable.class.php -rw-r--r-- 1 david david 316 2009-10-06 11:44 PluginUser.class.php -rw-r--r-- 1 david david 63 2009-10-06 11:44 PluginUserTable.class.php I want class in lib/model/[doctrine/]webservices. How can I do that ? Thanks for your support. David. -- Jonathan H. Wage (+1 415 992 5468) Open Source Software Developer Evangelist sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org You can contact Jonathan about Doctrine, Symfony and Open-Source or for training, consulting, application development, or business related questions at jonathan.w...@sensio.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: Future of Symfony Selenium
That makes sense. But making sense doesn't mean it will happen that way. :) -T On Mon, Oct 5, 2009 at 9:03 AM, Pablo Godel pgo...@gmail.com wrote: I am one of those that thinks that re-inventing the wheel is not good unless there is a really good reason for it (doing it better is one of those). Selenium is a major piece of software that does an awesome job. It would be really hard to do what it does in symfony. Pablo On Thu, Oct 1, 2009 at 1:47 PM, gamename ten...@tripitinc.com wrote: Hi, Is the plan for everyone to continue using Selenium for javascript- related testing, or will symfony eventually be able to support those tests natively? I would *really* like to use sfBrower, but cannot because most everything we have is based on javascript. -T -- Pablo Godel ServerGrove Networks http://servergrove.com/ -- Tks, -T --~--~-~--~~~---~--~~ 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] Problem of MySQL freeze when saving object
Hi, I have a strange error actually with my symfony installation (symfony 1.2.8 + PHP 5.3 + Wamp 2.0i) Sometimes, for example in a an admin generator module, when trying to save the object the script just freeze and never ends. When looking at the log, the last thing logged is the doctrine update query itself. When looking at phpMyAdmin, i'have 2 queries in SLEEP mode witch is of course the problem, but i have no idea how to correct... Witch is really strange is that error does not occur on all modules. I'll try tomorrow with another PHP version, the last 5.2.x Any help would be welcome... :) See you. COil PS: I have exactly the same problem on 2 computer (windows), including one with a fresh installation. __ Do You Yahoo!? En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités http://mail.yahoo.fr Yahoo! Mail --~--~-~--~~~---~--~~ 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] getId() not working on newly saved object
Hi all: I'm still pretty fresh to Symfony so bear with my newbie questions and confusions. Here's the deal: $this-product = new Product; // from BaseProduct::Product $obj = $this-product-save(); echo $obj-getProductId(); // product.product_id: int(11), autoincrement, primary key. The echo yields nothing though the object is saved to a row in the table. Thoughts? 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] Question about abbreviated syntax in YAML files
Hi, I have these schema and testa data: sfGuardUser: actAs: [Timestampable] columns: id: type: integer(4) primary: true autoincrement: true username: type: string(128) notnull: true unique: true algorithm: type: string(128) default: sha1 notnull: true salt: string(128) password: string(128) is_active: type: boolean default: 1 is_super_admin: type: boolean default: 0 last_login: type: timestamp indexes: is_active_idx: fields: [is_active] relations: groups: class: sfGuardGroup local: user_id foreign: group_id refClass: sfGuardUserGroup foreignAlias: Users permissions: class: sfGuardPermission local: user_id foreign: permission_id refClass: sfGuardUserPermission foreignAlias: Users Friends: class: sfGuardUser local: user1 foreign: user2 refClass: FriendReference equal: true sfGuardUserProfile: columns: sf_guard_user_id: integer(4) nombre: { type: string(60) } fotografia: { type: string(255) } descripcion: { type: string(4000) } relations: User: class: sfGuardUser foreignType: one #TEST DATA sfGuardUser: sgu_admin: username: fernando password: m is_super_admin: true sfGuardUserProfile: nombre: Fernando fotografia: fernando_salgado_siguenza.jpg descripcion: | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut As you can see at the end this is written at the end of the schema: relations: User: class: sfGuardUser foreignType: one If i dont write those lines, after doing doctrine:build-all-reload i get this error: Unknown method sfGuardUser::setSfguarduserprofile After reading this: http://www.doctrine-project.org/documentation/manual/1_0/en/yaml-schema-files#abbreviated-syntax i thought those lines would be verbosity. Do you know why i NEED to write those lines? Regards Javi --~--~-~--~~~---~--~~ 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 know if an object has been modified
No ideas? Nacho http://card.ly/nachocual --~--~-~--~~~---~--~~ 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 know if an object has been modified
Hi. Use isModifiedhttp://www.doctrine-project.org/Doctrine_Record/1_0#method_ismodifiedmethod. 2009/10/2 Ignacio Bergmann nachoc...@gmail.com Hello, this is my first message to the list... hope it isn't a silly question. I'm using Doctrine, and I have a class in my model which has a field that stores the name of a file (a picture). I have automated the deletion of those files when the corresponding record is delete using the postDelete method. Now, I want to automate the deletion of old files when they are changed for a new one. For this I was trying to use preSave and postSave methods, but I need to know if the 'file' field of my object is different of the one stored in the database. I have tried using the getModified method, but it gives me the new value of the field, instead of the old one. Also, the getLastModified method that the Doctrine documentatios suggests doesn't exist. I'm trying to implement this in the class definition of the object instead of implementing it on the form definition file, I think this is were this kind of task belong, but I might be wrong (I made it work overriding the doSave method of the form, but I still want to move it to the class). I'm open to suggestions. Thanks, Nacho http://card.ly/nachocual My code (that doesn't work): class Mascotas extends BaseMascotas { var $cambios; public function preSave($event) { $this-cambios = $event-getInvoker()-getModified(true); } public function postSave($event) { if($this-cambios['foto1']) { $this-deletePictures($this-cambios['foto1']); } } } -- With the best regards, Andy. --~--~-~--~~~---~--~~ 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] Sf 1.2 route cache problems in prod with sfDoctrineRoute patterns
Hi! I've encountered a strange problem with routing in my symfony 1.2 with doctrine application. I tracked it down to routing cache problems. I have two routes: user_edit_profile: url: /user/:nick/settings class: sfDoctrineRoute options: { model: sfGuardUserProfile, type: object } param: { module: user, action: settings } requirements: sf_method: [get, post] user_edit_own_profile: url: /user/settings/* param: { module: user, action: ownSettings } The first one enables administrators to easily edit any user profile, the second one is provided for convenience for an end user. The action ownSettings is secured in security.yml and looks like that: public function executeOwnSettings(sfRequest $request) { $this-redirect($this-generateUrl(user_edit_profile, $this- getUser()-getGuardUser()-getProfile())); } The scenario is: 1) I login with an account maticomp. I go to /user/settings and am redirected to /user/maticomp/settings. 2) I logout and log in with another account test. I go to /user/ settings and am redirected to ... /user/maticomp/settings I modified the action to print some debug information instead of doing redirects: public function executeOwnSettings(sfRequest $request) { print $this-getUser()-getGuardUser()-getProfile()-getNick() . br; print $this-generateUrl(user_edit_profile, $this-getUser()- getGuardUser()-getProfile()); return sfView::NONE; } The result now is: test index.php/user/maticomp/settings After doing symfony cc in command line it's: test index.php/user/test/settings The problem is non existent in dev environment (where I guess routing cache is disabled). It is also non-existent when I disable access to the directory where route cache is stored (chmod 222 routing). What could be the possible reason that Symfony caches complete routing info when objects are passed to sfDoctrineRoute? Maybe I am missing something here? I would be very glad for any suggestions how to deal with this problem. Thanks in advance, Best regards, Mateusz Papiernik --~--~-~--~~~---~--~~ 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: getId() not working on newly saved object
$this-product-getId() will give you the auto increment ID of the row just inserted 2009/10/6 Josh joshlaro...@gmail.com Hi all: I'm still pretty fresh to Symfony so bear with my newbie questions and confusions. Here's the deal: $this-product = new Product; // from BaseProduct::Product $obj = $this-product-save(); echo $obj-getProductId(); // product.product_id: int(11), autoincrement, primary key. The echo yields nothing though the object is saved to a row in the table. Thoughts? 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] sfGuardPlugin clears sfGuardUserProfile
I am using sfGuardPlugin to manage users in an application. I created sfGuardUserProfile to add fields like name, email, website, etc. It all works nicely, but when I update sfGuardUser through the admin generator, it clears sfGuardUserProfile. I see the following in the sql log: 629 QueryUPDATE sf_guard_user_profile SET `FIRST_NAME`='', `UPDATED_AT`=NULL WHERE sf_guard_user_profile.ID=1 629 QueryUPDATE sf_guard_user SET `IS_ACTIVE`=1 WHERE sf_guard_user.ID=1 Is there a way to avoid this behavor? Thanks Pablo Godel --~--~-~--~~~---~--~~ 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 install a symfony website
On Oct 5, 2:54 am, Eno symb...@gmail.com wrote: On Mon, 5 Oct 2009, Sid Bachtiar wrote: I was trying to look something more for non-developer. Let's say I developed a website then when I give the source code to my client (who isn't computer illiterate, but is not familiar with Symfony); at the moment I'll have to teach them a lot of things on how to install/deploy, symfony commands (clear cache), how to change database settings, and so on. Frankly, what you're asking makes no sense. Deploying a web site is not something you can just give to someone who is not technical. One of the big weaknesses of Symfony is that it can not be deployed as easily as WordPress. The fact that non-technical people have an easy time installing WordPress gives WordPress much of its presence on the web scene. --~--~-~--~~~---~--~~ 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 install a symfony website
On Oct 5, 7:26 am, Tom Boutell t...@punkave.com wrote: This is true, but if you deploy with svn don't forget: RewriteRule (\.svn)/(.*?) - [F,L] In your .htaccess. You don't want people snooping in the .svn folders. You can svn export and none of the .svn folders will be exported. On Oct 5, 3:06 am, Gareth McCumskey gmccums...@gmail.com wrote: First, in your batches directory for your symfony write a batch script (in PHP even if you want) that will run all the necessary symfony commands needed, like symfony cc etc. Then make sure its all committed to SVN. I have found deploying to a server easier to do with SVN rather than rsync which is what the official symfony docs recommend. So you can have your sys admin svn checkout the application, run the batch script and away you go. You can even have your deployment script add the correct Virtual Host settings into apache for you. This is of course assuming your running a *nix box. On Mon, Oct 5, 2009 at 9:02 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Of course not. I'm talking about someone technical, who knows how to install the like of Wordpress, and other popular PHP, but not familiar with Symfony, nor want/need to learn development in Symfony. On Mon, Oct 5, 2009 at 7:54 PM, Eno symb...@gmail.com wrote: On Mon, 5 Oct 2009, Sid Bachtiar wrote: I was trying to look something more for non-developer. Let's say I developed a website then when I give the source code to my client (who isn't computer illiterate, but is not familiar with Symfony); at the moment I'll have to teach them a lot of things on how to install/deploy, symfony commands (clear cache), how to change database settings, and so on. Frankly, what you're asking makes no sense. Deploying a web site is not something you can just give to someone who is not technical. -- -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Gareth McCumskeyhttp://garethmccumskey.blogspot.com twitter: @garethmcc --~--~-~--~~~---~--~~ 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 install a symfony website
Yeah, I'm thinking: 1. Have install.php on web folder and lock it or delete it after installation is successful 2. Requirements checking if the environment has everything required (plugins should be able to add requirement check too) 3. Let end user enters database information (like in Wordpress) 4. Click 'Install' OK I'm sure it's not that easy, but I think it is doable. Part of the check would be to check if non-public folder (non web folder) can be protected (made non-public), e.g.: htaccess, etc, etc. Regards, Sid Bachtiar -- Blue Horn Ltd - System Development http://bluehorn.co.nz On Wed, Oct 7, 2009 at 11:32 AM, Jake Barnes lkrub...@geocities.com wrote: On Oct 5, 2:54 am, Eno symb...@gmail.com wrote: On Mon, 5 Oct 2009, Sid Bachtiar wrote: I was trying to look something more for non-developer. Let's say I developed a website then when I give the source code to my client (who isn't computer illiterate, but is not familiar with Symfony); at the moment I'll have to teach them a lot of things on how to install/deploy, symfony commands (clear cache), how to change database settings, and so on. Frankly, what you're asking makes no sense. Deploying a web site is not something you can just give to someone who is not technical. One of the big weaknesses of Symfony is that it can not be deployed as easily as WordPress. The fact that non-technical people have an easy time installing WordPress gives WordPress much of its presence on the web scene. --~--~-~--~~~---~--~~ 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 install a symfony website
One of the big weaknesses of Symfony is that it can not be deployed as easily as WordPress. The fact that non-technical people have an easy time installing WordPress gives WordPress much of its presence on the web scene. As far as I know symfony is not a blog, and it's made with _technical_ people in mind. And for technical people, willing to read the manual, it's as easy to deploy as it can possibly be. Mariusz --~--~-~--~~~---~--~~ 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 install a symfony website
Wordpress is an application, Symfony is a framework that you can use to build applications. sf provides all the parts to make installers - you just need to glue 'em together. On Wed, 07 Oct 2009 00:32:18 +0200, Jake Barnes lkrub...@geocities.com wrote: On Oct 5, 2:54 am, Eno symb...@gmail.com wrote: On Mon, 5 Oct 2009, Sid Bachtiar wrote: I was trying to look something more for non-developer. Let's say I developed a website then when I give the source code to my client (who isn't computer illiterate, but is not familiar with Symfony); at the moment I'll have to teach them a lot of things on how to install/deploy, symfony commands (clear cache), how to change database settings, and so on. Frankly, what you're asking makes no sense. Deploying a web site is not something you can just give to someone who is not technical. One of the big weaknesses of Symfony is that it can not be deployed as easily as WordPress. The fact that non-technical people have an easy time installing WordPress gives WordPress much of its presence on the web scene. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ --~--~-~--~~~---~--~~ 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 install a symfony website
sf provides all the parts to make installers - you just need to glue 'em together. Correct! And it would make it easier to spread Symfony to the mass if it has a generic installer built in. I know, I know, what don't I build it myself? I'd like to, but at the moment I'm pretty stretched out. But it also good to talk about it first, someone might points out why this is difficult, etc, etc. A Symfony open source project called Siwapp (an invoicing system) tried/tries/trying to have this kind of installer (www.siwapp.org). Kind regards, Sid On Wed, Oct 7, 2009 at 12:09 PM, david da...@inspiredthinking.co.uk wrote: Wordpress is an application, Symfony is a framework that you can use to build applications. sf provides all the parts to make installers - you just need to glue 'em together. On Wed, 07 Oct 2009 00:32:18 +0200, Jake Barnes lkrub...@geocities.com wrote: On Oct 5, 2:54 am, Eno symb...@gmail.com wrote: On Mon, 5 Oct 2009, Sid Bachtiar wrote: I was trying to look something more for non-developer. Let's say I developed a website then when I give the source code to my client (who isn't computer illiterate, but is not familiar with Symfony); at the moment I'll have to teach them a lot of things on how to install/deploy, symfony commands (clear cache), how to change database settings, and so on. Frankly, what you're asking makes no sense. Deploying a web site is not something you can just give to someone who is not technical. One of the big weaknesses of Symfony is that it can not be deployed as easily as WordPress. The fact that non-technical people have an easy time installing WordPress gives WordPress much of its presence on the web scene. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ 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] upload multiple files with ajax
hi guys, I need upload images to my server, for example Image_1 Comment_Image_1 Image_2 Comment_Image_3 Image_3 Comment_Image_3 maybe with ajax or not, but i need save the values in a DB, --~--~-~--~~~---~--~~ 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: About embed forms
Try this for adding an object's PARENT form to the child form. http://www.symfony-project.org/blog/2008/11/07/new-in-symfony-1-2-doctrine-goodies Where it says Edit/Add Author Exactly in the middle of the document. Me, I'm looking to add Chidren to the Parent Object, but not a large quanity of them like this guy did: http://www.thatsquality.com/articles/can-the-symfony-forms-framework-be-domesticated-a-simple-todo-list Also, he had to go to a lot of trouble to get it to work. There's got to be a way to add the children, or a blank one without going to the trouble that he went tol. (doctrine btw) ParticularForm extends BaseParticularForm{ function configuration(){ $this-getObject()-getRelatedObjectForm On Oct 5, 11:20 pm, Francisco José Núñez Rivera elfra...@gmail.com wrote: I tried it with $opinion = new Opinion(); $opfeat = new $opinion-OpinionFeature; but cant find the class OpinionFeature... Otherwise i do the same you write (more or less). I think that when i'm showing opinion form it creates a new Opinion(); variable. Then i use that variable to set the new OpinionFeature var... $opfeat-setOpinionId($this-getObject()-id); $opfeat-setFeatureId($feature-getId()); $OFform = new OpinionFeatureForm($opfeat); $this-embedForm('feature_'.$feature-getId(), $OFform); But it doesnt work... i have to overwrite saveEmbedForms public function saveEmbeddedForms($con = null, $forms = null) { foreach($this-getEmbeddedForms() as $opinionForm) { $opinionForm-getObject()-setOpinionId($this-getObject()-getId()); } parent::saveEmbeddedForms($con, $forms); } I think there's a easier way to do this but.. i dont know. :( 2009/10/6 Dennis gear...@sbcglobal.net I got this off of a Fabien post, somewhere. If you look at it, it makes everything connect to the same parent record. It SHOULD save correctly. I am goin to try it in my project tonight. Let me know if it works for you. $user = new User(); $profile = new $user-Profile; $userForm = new UserForm($user); $profileForm = new ProfileForm($profile); $userForm-embedForm('Profile', $profileForm); On Oct 5, 2:13 am, elkrema elfra...@gmail.com wrote: Hi Dennis, there is my schema: Feature: tableName: feature columns: id: type: integer(8) primary: true autoincrement: true name: type: string(255) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: OpinionFeature: local: id foreign: feature_id type: many Opinion: tableName: opinion columns: id: type: integer(8) primary: true autoincrement: true title: type: string(255) notnull: true opiniontxt: type: string(2147483647) notnull: true is_active: type: integer(1) default: '0' notnull: true token: type: string(255) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: OpinionFeature: local: id foreign: opinion_id type: many OpinionFeature: tableName: opinion_feature columns: opinion_id: type: integer(8) primary: true feature_id: type: integer(8) primary: true score: type: float(2147483647) notnull: true created_at: timestamp(25) updated_at: timestamp(25) relations: Opinion: local: opinion_id foreign: id type: one Feature: local: feature_id foreign: id type: one Its very similar to your schema. Mine havent got foreign_type but i think it works same yours... no? I did that with mysql workbench and then build schema... :) I think the problem was save embed forms i have to overwrite the saveEmbedForms function to set the opinionid of the OpinionFeature just at the moment of insert the opinion. Doing that it works, but i dont know if its the right way. Thank you very much. On 5 oct, 05:10, Dennis gear...@sbcglobal.net wrote: So what you have is a: Opinion--1-to-many --OpinionFeature--many-to-1--Feature (above is a good way to show a schema) So you have to set up your schema to reflect that: Keep in mind that you have to create the Parents, before creating the children. Parents HAVE an ID, Children are GIVEN or USE and ID. Parents are 'Opinion' and 'Feature'. Opinion: tableName: opinion columns: opinion_id: type: integer(8) primary: true sequence: opinion_opinion_id opinion_name: type: string(65) notnull: true relations: OpinionFeature: local: opinion_id foreign: opinion_id type: many
[symfony-users] Re: problem with undefined table and embedded form
BTW, which is the parent object, and which is the child object: vehiculo vs. sinestro? On Sep 9, 3:26 pm, Eno symb...@gmail.com wrote: On Wed, 9 Sep 2009, Abraham Montilla wrote: and as i said, i don't know why did it work before cause the autoincrement line is set from the beginning of the project, therefore, the firstime i embedded the form and added a new row that line was in schema.yml :S i really don't know what did i change, but anyway, problem solved =) Problems like this highlight the need to use migrations so database changes are also versioned. -- --~--~-~--~~~---~--~~ 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: getId() not working on newly saved object
Yeah, this is not working. I guess that's what I'm saying. I'm taking two new objects, populating them, then saving one and using that ID to populate a column in the other object. For whatever reason, this is not working. BUT, the row is saved to the DB upon $obj-save() OR $this-product-save() or whatever else I try. I'm not using propel (rather, the original author didn't us it) but this is what the BaseObject class looks like: class BaseProductProfile extends BaseEntityRecord { public function setTableDefinition() { $this-setTableName('product_profile'); $this-hasColumn('id', 'integer', 11, array ('primary'=true, 'required'=true, 'autoincrement'= true)); $this-hasColumn('user_characteristic_id', 'integer', 11, array()); $this-hasColumn('patient_first_name', text, null, array()); $this-hasColumn('patient_last_name', text, null, array()); $this-hasColumn('updated', 'timestamp', null, array()); $this-setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_NONE); } public function setUp() { $this-hasOne('ProductProfile as Product', array('local' = 'id', 'foreign'='id')); } } Here's the schema for the object in question: CREATE TABLE IF NOT EXISTS `product_profile` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_characteristic_id` int(11) NOT NULL, `product_first_name` varchar(128) NOT NULL, `product_last_name` varchar(128) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=127 ; On Oct 6, 2:13 pm, Nick Winfield pion...@superhaggis.com wrote: $this-product-getId() will give you the auto increment ID of the row just inserted 2009/10/6 Josh joshlaro...@gmail.com Hi all: I'm still pretty fresh to Symfony so bear with my newbie questions and confusions. Here's the deal: $this-product = new Product; // from BaseProduct::Product $obj = $this-product-save(); echo $obj-getProductId(); // product.product_id: int(11), autoincrement, primary key. The echo yields nothing though the object is saved to a row in the table. Thoughts? 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] if (condition): endif: not working
Hi all, I am working on symfony since last 1 month. Yday I just installed symfony to my other laptop. I dont know why I am getting errors in my templates which works for my pc. I am gettting errors everywhere when I used ?php if(condition): endif: ? if I have used ?php if{} ? (traditional php syntax) then it is working. Can anybody help me? Thanks in advance. --~--~-~--~~~---~--~~ 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: if (condition): endif: not working
It should be: ?php if (condition): ? h1Hola hola hola/h1 ?php endif; // with semi colon ? On Wed, Oct 7, 2009 at 2:58 PM, Avani avani.v.puj...@gmail.com wrote: Hi all, I am working on symfony since last 1 month. Yday I just installed symfony to my other laptop. I dont know why I am getting errors in my templates which works for my pc. I am gettting errors everywhere when I used ?php if(condition): endif: ? if I have used ?php if{} ? (traditional php syntax) then it is working. Can anybody help me? Thanks in advance. -- Blue Horn Ltd - System Development http://bluehorn.co.nz --~--~-~--~~~---~--~~ 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: if (condition): endif: not working
Oh sorry, it was typing mistake. whole project is working in my 1 pc. When I copy the same into my other pc, it is giving errors Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\td\apps \core\templates\layout.php on line 354 everywhere where I have used ?php if(condition) : ? something ?php endif; ? On Oct 7, 9:59 am, Sid Bachtiar sid.bacht...@gmail.com wrote: It should be: ?php if (condition): ? h1Hola hola hola/h1 ?php endif; // with semi colon ? On Wed, Oct 7, 2009 at 2:58 PM, Avani avani.v.puj...@gmail.com wrote: Hi all, I am working on symfony since last 1 month. Yday I just installed symfony to my other laptop. I dont know why I am getting errors in my templates which works for my pc. I am gettting errors everywhere when I used ?php if(condition): endif: ? if I have used ?php if{} ? (traditional php syntax) then it is working. Can anybody help me? Thanks in advance. -- Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz --~--~-~--~~~---~--~~ 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: if (condition): endif: not working
Please provide lines 345 - 365 of C:\xampp\htdocs\td\apps\core\templates\layout.php would be helpful. Jeremy On Tue, Oct 6, 2009 at 9:03 PM, Avani avani.v.puj...@gmail.com wrote: Oh sorry, it was typing mistake. whole project is working in my 1 pc. When I copy the same into my other pc, it is giving errors Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\td\apps \core\templates\layout.php on line 354 everywhere where I have used ?php if(condition) : ? something ?php endif; ? On Oct 7, 9:59 am, Sid Bachtiar sid.bacht...@gmail.com wrote: It should be: ?php if (condition): ? h1Hola hola hola/h1 ?php endif; // with semi colon ? On Wed, Oct 7, 2009 at 2:58 PM, Avani avani.v.puj...@gmail.com wrote: Hi all, I am working on symfony since last 1 month. Yday I just installed symfony to my other laptop. I dont know why I am getting errors in my templates which works for my pc. I am gettting errors everywhere when I used ?php if(condition): endif: ? if I have used ?php if{} ? (traditional php syntax) then it is working. Can anybody help me? Thanks in advance. -- Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz --~--~-~--~~~---~--~~ 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: Question about abbreviated syntax in YAML files
I think the error says it. If you don't specify the one side it won't populate that model with the setter for user profile. Use build-all to see what the generator is generating. I find it easier to read and understand the doctrine models. On Oct 6, 2:48 pm, tirengarfio tirengar...@gmail.com wrote: Hi, I have these schema and testa data: sfGuardUser: actAs: [Timestampable] columns: id: type: integer(4) primary: true autoincrement: true username: type: string(128) notnull: true unique: true algorithm: type: string(128) default: sha1 notnull: true salt: string(128) password: string(128) is_active: type: boolean default: 1 is_super_admin: type: boolean default: 0 last_login: type: timestamp indexes: is_active_idx: fields: [is_active] relations: groups: class: sfGuardGroup local: user_id foreign: group_id refClass: sfGuardUserGroup foreignAlias: Users permissions: class: sfGuardPermission local: user_id foreign: permission_id refClass: sfGuardUserPermission foreignAlias: Users Friends: class: sfGuardUser local: user1 foreign: user2 refClass: FriendReference equal: true sfGuardUserProfile: columns: sf_guard_user_id: integer(4) nombre: { type: string(60) } fotografia: { type: string(255) } descripcion: { type: string(4000) } relations: User: class: sfGuardUser foreignType: one #TEST DATA sfGuardUser: sgu_admin: username: fernando password: m is_super_admin: true sfGuardUserProfile: nombre: Fernando fotografia: fernando_salgado_siguenza.jpg descripcion: | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut As you can see at the end this is written at the end of the schema: relations: User: class: sfGuardUser foreignType: one If i dont write those lines, after doing doctrine:build-all-reload i get this error: Unknown method sfGuardUser::setSfguarduserprofile After reading this: http://www.doctrine-project.org/documentation/manual/1_0/en/yaml-sche... i thought those lines would be verbosity. Do you know why i NEED to write those lines? Regards Javi --~--~-~--~~~---~--~~ 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: if (condition): endif: not working
Well, without seeing all the code, it's hard to tell, but you are mixing if () { /* thirty lines later */ } with if (): and endif; syntax. I would suggest that you clean up your code format, use one consistent syntax and you will likely find that you actually have an open if somewhere - which is why you have the extraneous ending curly. Jeremy On Tue, Oct 6, 2009 at 9:23 PM, Avani avani.v.puj...@gmail.com wrote: Below is my code 345: !-- show only in trip-profile page OR multimedia pages -- 346: ?php 347: if($show_left_sliding_menu == 'yes' || $module == 'photolibrary' || $module == 'videolibrary'){ ? 348: 349:a ?php if ($tab==photolibrary): ? class=current ? endif; ? href=?php echo url_for('photolibrary/index'.$multimedia_param); ?img src=/ images/photo-350:app.png title=Photo Library alt=Photo Library / /abr / 351: 352:a id=smile ?php if ($tab==videolibrary): ? class=current ? endif; ? href=?php echo url_for('videolibrary/index'.$multimedia_param); ?img 353:src=/images/video-app.png title=Video Library alt=Video Library //abr / 354:?php } ? 355: 356: 357:?php 358: if($show_left_sliding_menu == 'yes') { ? 359:a href=?php echo url_for ('trip/maps?trip_folder_id='.$trip_folder_id_str);?img src=/ images/map-app.png title=Map alt=map //abr / 360:?php } ? 361: 362:/div 363:/div 364:!-- show only in trip-profile page -- Here, if I delete line 349 to 353, then it is working correctly. Dont know why is the problem?? On Oct 7, 10:05 am, Jeremy Thomerson jeremythomer...@gmail.com wrote: Please provide lines 345 - 365 of C:\xampp\htdocs\td\apps\core\templates\layout.php would be helpful. Jeremy On Tue, Oct 6, 2009 at 9:03 PM, Avani avani.v.puj...@gmail.com wrote: Oh sorry, it was typing mistake. whole project is working in my 1 pc. When I copy the same into my other pc, it is giving errors Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\td\apps \core\templates\layout.php on line 354 everywhere where I have used ?php if(condition) : ? something ?php endif; ? On Oct 7, 9:59 am, Sid Bachtiar sid.bacht...@gmail.com wrote: It should be: ?php if (condition): ? h1Hola hola hola/h1 ?php endif; // with semi colon ? On Wed, Oct 7, 2009 at 2:58 PM, Avani avani.v.puj...@gmail.com wrote: Hi all, I am working on symfony since last 1 month. Yday I just installed symfony to my other laptop. I dont know why I am getting errors in my templates which works for my pc. I am gettting errors everywhere when I used ?php if(condition): endif: ? if I have used ?php if{} ? (traditional php syntax) then it is working. Can anybody help me? Thanks in advance. -- Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---