Hey Fabian,

I actually wonder if what you describe there would really help, and I
can only see it applicable for the delete method, and I guess there
would have to be an opportunity to determine the following redirect
and optionally set a flash message... not sure it's worth the trouble,
although I have to admin there's something about it.. I wonder if I
miss other applications of it.

Daniel

On Aug 27, 7:06 am, "Fabian Lange" <[EMAIL PROTECTED]>
wrote:
> What I like is that this usage is intuitive:
> foreach($records as $record)
> {
>   echo link_to_code($record,'delete()', 'Delete'.$recod->getName());}
>
> if the the framework would expose the requested method of the object
> automatically as an webservice and could inject automatically the correct
> instance of record. this would be very nice.
>
> But the code you wrote will just delete all objects fro the database and
> display nonfunctional links
>
> .: Fabian
>
> On Wed, Aug 27, 2008 at 3:52 PM, Łukasz Stefaniak <[EMAIL PROTECTED]>wrote:
>
>
>
> > Tom Haskins-Vaughan pisze:
> > > You need to create a link in your template that calls a method in your
> > > actions.
>
> > > What is $all?
>
> > > torso wrote:
>
> > >> Hi. I am trying to delete data from database by clicking. But when I
> > >> give $all[$i]->delete() It deletes all data from database. I am trying
> > >> to delete only one. Can somebody help, please.
>
> > >> <?php
> > >>      for ($i=0; $i<count($all); $i++){
> > >>              $header  = $all[$i]->getHeader();
> > >>              $content = $all[$i]->getContent();
> > >>              $created = $all[$i]->getCreatedAt();
> > >>              echo '<a href="'.$all[$i]->delete().'">Delete</a>';
> > >>      }?>
>
> > Doing it in such way(i assume $all is collection of Propel objects) you
> > call delete() on every object which in iteration deletes everything...
> > if you don't know how to handle such situations try using CRUD generator
> > as example how to do it.
>
> > echo link_to('something/delete?id='.$all[$i]->getId(),'Delete');
>
> > And create delete action.
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to