Friday, April 30, 2010

Re: Table Naming convention problem

the table name is fixed i cont change the table name to "adb_compaign"

On Apr 30, 1:47 pm, Andrei Mita <andrei.m...@gmail.com> wrote:
> You didn't fallow the conventions :)
>
> http://book.cakephp.org/view/23/File-and-Classname-Conventions
>
> Table name should be adb_campaigns
> Controller file name: abd_campaigns_controller.php
> Controller class name: AdbCampaignsController
>
> and so on....
>
> Read the conventions carefully.
>
>
>
> On Fri, Apr 30, 2010 at 11:40 AM, Master Ram <ramganga...@gmail.com> wrote:
> > HI. all i am new to cakephp
>
> > i have table name called: adb_campaign
>
> > my contorller is:
> > my controller Name: compaigns_controller.php
>
> > <?php
> > class CompaignsController extends AppController {
>
> >    //var $tablePrefix = 'adb_';//var $name = "Users";
> >    var $name = 'adb_'
>
> >    var $uses=array('Client','User','Campaign');
> >    //var $uses=array('User');
>
> >    var $helpers = array('Html', 'Form');
> >    function mycampaigns()
> >    {
> >        $campaigns = $this->Campaign->find('all');
> >        $this->set('campaign',$campaigns);
> >    }
>
> > }
> > ?>
>
> > my modle Name: campaign.php
>
> > <?php
> > class Campaign extends AppModel {
>
> >   // var $tablePrefix = 'adb_';
> >    var $useTable ='adb_'
>
> > }
> > ?>
>
> > in the view folder name: campaign
>
> > mycampaigns.ctp
>
> > <?php
> >                                                        $a = array();
> >                                                        $i=1;
>
> > foreach( $campaigns as $campaign ):
> >                                                        $a[$i] =
> > $campaign['Campaign']['jobno'];
> >                                                        $i++;
> >                                                        endforeach;
> >                                                        echo $form-
> > >select('campaign ', $a, 0,
> >                                                        array('style'
> > => 'width: 50%'),false);
> >                                                        ?>
>
> > where i made the mistake please help me
>
> > regards:
> > Master
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: