> this whole thread is a waste of time, as saving HABTM associations
> using selectTags is covered in the models section of the manual!
>
> go to http://manual.cakephp.org/chapter/models and search for 'Saving
> hasAndBelongsToMany Relations' (hint, towards the bottom).

actually, on reading, it doesn't provide any controller code, just the
views, hmm, so, using the view files from the example, I would do
soemthing like:

function edit($post_id)
{
        $this->Post->id = $post_id;
        // nothign submitted yet
        if (empty($this->data))
        {
                // get tag names/ids as key value pairs
                $this->set('tags', $this->Post->Tag->generateList());
                // render form
                $this->render();
        }
        // data submitted
        else
        {
                // no need to do anything else with the data provided
                // you've followed the conventions in the view
                if ($this->Post->save($this->data))
                {
                        $this->flash('your post was saved', '/posts');
                }
                else
                {
                        $this->set('data', $this->data);
                        $this->validateErrors($this->Post);
                        $this->render();
                }
        }
}

hope this helps.

jon

>
> hope the tone doesn't appear ranty, I am trying to help (the answers
> are all there).
>
> jon
>
> On 3/22/07, John David Anderson (_psychic_) <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Mar 21, 2007, at 4:41 PM, stevenoone wrote:
> >
> > >
> > > I'm sure for some people the Cake approach makes perfect sense and I
> > > don't doubt that this framework, when used by someone who understands
> > > it well, can dramatically speed development time. Unfortunately
> > > there's people like myself for whom much of this is new, and it's not
> > > unreasonable for us to be frustrated by nuances we haven't yet wrapped
> > > our brains around. Everyone's experience learning this framework is
> > > going to be unique based on their programming background and
> > > familiarity with MVC concepts. It's wonderful that individuals are
> > > volunteering their time to help others get started, but it seems like
> > > sometimes that "help" consists of handwaving half-answers and links to
> > > other semi-related threads.
> > >
> > > Most of us aren't idiots and we wouldn't be posting questions if we
> > > hadn't tried to come up with the answers ourselves. If you don't want
> > > to help in this forum - don't. If you're tired of answering the same
> > > questions, provide good documentation or some well-commented sample
> > > apps and let us pick through the code. This "blame the user for being
> > > confused" attitude in some of these posts and evident in the "essay"
> > > linked above doesn't help anybody.
> >
> > In order for everyone to be happy we're all going to need to try to
> > meet in the middle.
> >
> > For people asking questions: make a better effort to find previously
> > answered questions. Search this group, the Bakery, the Manual, API–
> > and if all else fails–Google. Chances are if you're new, its been
> > asked before. Twice. Its okay to get frustrated with a new system,
> > but try to keep that in check.
> >
> > For the development team: we'll try our best to bulletproof the docs.
> > I try to keep a good handle on the frustrations here and in the IRC
> > channel. Please know we're trying to do what you're asking. Its okay
> > to get frustrated at the lack of resources and constant influx of
> > n00bs, but try to keep that in check.
> >
> > I suppose these both go without saying. Let's just keep plugging on,
> > people.
> >
> > -- John
> >
> > > >
> >
>
>
> --
>
>
> jon bennett
> t: +44 (0) 1225 341 039 w: http://www.jben.net/
> iChat (AIM): jbendotnet Skype: jon-bennett
>


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to