All you need to do is insert the post_type into the data array before  
saving it to the database.
Either insert a hidden field into the form that you use to create the  
post, or insert it in the controller.

$this->data['Post']['post_type'] = 'news';
$this->Post->save($this->data);

On 11 Oct 2008, at 10:50, jfgreco wrote:

>
> I am designing a CMS system and am new to CakePHP. I am porting
> everything to Cake from a legacy system, so I have a defined database
> already.
>
> I have a table of posts and in that table I have a column called
> post_type which I populate with News, Page, Event or Admin. I don't
> want the user to have to choose the type when posting. I want them to
> click a link like Post News or Post A New Page. Is there a good way to
> use a single base controller to build off of? I created the
> PostController and it works for a good base, but what is the best way
> to build out from there? Any ideas will be helpful.
>
> I consolidated into one table to reduce duplicate table structures for
> essentially the same type of item.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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