<?=$this->Form-
>create('Posts',array('id'=>'articleform','enctype'=>'multipart/form-
data','class'=>'form'));?>
<?=$this->Form-
>input('content',array('type'=>'textarea','label'=>'Quotes'));?>
<?=$this->Form-
>input('Author.name',array('type'=>'text','label'=>'Author'));?>
<?=$this->Form->input('Tag.name',array('label'=>'Tags [comma
separated]'));?>
<?php echo $this->Form->end('Add Quote'); ?>
Here, content is posts table's field
authors table has name field which will store author name
tags table has name field which will store tags
posts_tags table will store post_id and tag_id
Post Model has the following relation
var $belongsTo = array('User','Author');
var $hasAndBelongsToMany = array('Tag');
var $hasMany = array('Comment');
I have quotes website of mine. I want to convert it into cakephp. This
is my first try in cakephp.
I don't want to learn wrongly.
I am not getting email alert :( where should i activate it in google
groups?
On Jun 18, 9:16 pm, Tilen Majerle <[email protected]> wrote:
> show us you form code and other stuff
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2011/6/18 Tilen Majerle <[email protected]>
>
>
>
>
>
>
>
> > all what i can tell you is how to get last insert id...in controller with
> > $this->ModelName->getLastInsertID();
> > --
> > Lep pozdrav, Tilen Majerle
> >http://majerle.eu
>
> > 2011/6/18 prabha <[email protected]>
>
> >> There is form, where user can enter tags, authors and posts.
>
> >> Page is displayed from post controller.
>
> >> Post controllers' add function should handle the insert. How to insert
> >> author in authors table and get the lastinsertid? In the same way,
> >> tags will have more than one insert. Tags should be added in tags and
> >> posts_tags table.
>
> >> I hope after this, everything will be fine to create all the sites
> >> using cakephp.
>
> >> --
> >> Our newest site for the community: CakePHP Video Tutorials
> >>http://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> [email protected] For more options, visit this group
> >> athttp://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php