Re: naming convention problem
Set your debug to at least 1 and see what the error is telling you then. It will give you a better idea of what's going on. On Mon, Jun 21, 2010 at 6:26 AM, Master Ram wrote: > Hi.. > > i have table name called: "promoter_interest_hobbies" > > i used the module name: "PromoterInterestHobbies" > > module code: > > class PromoterInterestHobbie > extends AppModel { > > var $name = > 'PromoterInterestHobbie'; > > controller Name : "promoter_interest_hobbies" > > class > PromoterInterestHobbiesController extends AppController { > > var $name = > "PromoterInterestHobbies"; > >function val(){ > > Note: the val CTP file is placed in the "promoter" folder. > > its giving an error: > > Not Found > > Error: The requested address '/promoter_interest_hobbies/ > promoters_step_three' was not found on this server. > > this is my submit function : > > e($form->create('PromoterInterestHobbie', > array('controller' => > 'promoter_interest_hobbies', > > 'action' => 'val'))); > > where i missed out..? > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: naming convention problem
Try using PromoterInterestHobby as the model class. Hobbies is plural of hobby. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 21 Jun 2010, at 11:26, Master Ram wrote: > Hi.. > > i have table name called: "promoter_interest_hobbies" > > i used the module name: "PromoterInterestHobbies" > > module code: > > class PromoterInterestHobbie > extends AppModel { > > var $name = > 'PromoterInterestHobbie'; > > controller Name : "promoter_interest_hobbies" > > class > PromoterInterestHobbiesController extends AppController { > > var $name = > "PromoterInterestHobbies"; > >function val(){ > > Note: the val CTP file is placed in the "promoter" folder. > > its giving an error: > > Not Found > > Error: The requested address '/promoter_interest_hobbies/ > promoters_step_three' was not found on this server. > > this is my submit function : > > e($form->create('PromoterInterestHobbie', > array('controller' => > 'promoter_interest_hobbies', > > 'action' => 'val'))); > > where i missed out..? > > 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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
naming convention problem
Hi.. i have table name called: "promoter_interest_hobbies" i used the module name: "PromoterInterestHobbies" module code: class PromoterInterestHobbie extends AppModel { var $name = 'PromoterInterestHobbie'; controller Name : "promoter_interest_hobbies" class PromoterInterestHobbiesController extends AppController { var $name = "PromoterInterestHobbies"; function val(){ Note: the val CTP file is placed in the "promoter" folder. its giving an error: Not Found Error: The requested address '/promoter_interest_hobbies/ promoters_step_three' was not found on this server. this is my submit function : e($form->create('PromoterInterestHobbie', array('controller' => 'promoter_interest_hobbies', 'action' => 'val'))); where i missed out..? 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
Read all the previous responses - my follow up was because you also had a problem with your controller function. AD7six's response is the one you should follow. Jeremy Burns jeremybu...@me.com On 30 Apr 2010, at 10:11, Master Ram wrote: > that is not my problem. who to use the table name in controller my > table name is "adb_campaign"(we can not change the table) what is the > model, view and controller and how to use it. > > thanks sir > > On Apr 30, 2:00 pm, Jeremy Burns wrote: >> I was wrong about something - your view is called mycampaigns, not >> mycampaign - sorry. However, it looks like you are getting back a list of >> campaigns rather than just one. So I would change the function code to: >> >> function mycampaigns() { >> $campaigns = $this->Campaign->find('all'); >> $this->set('campaigns',$campaigns); >> >> } >> >> Notice the pluralisation of the the campaignS variable, which is what your >> view is looking for. You can shorten it further too: >> >> function mycampaigns() { >> $this->set( >> 'campaigns', >> $this->Campaign->find('all') >> ); >> >> } >> >> Jeremy Burns >> jeremybu...@me.com >> (Skype) +44 208 123 3822 (jeremy_burns) >> (m) +44 7973 481949 >> (h) +44 208 530 7573 >> >> On 30 Apr 2010, at 09:53, Jeremy Burns wrote: >> >> >> >>> It is rarely a good idea to stray from conventions >>> (http://book.cakephp.org/view/22/CakePHP-Conventions) if you can avoid it. >>> Is it too late to re-factor your database? Assuming it is... >> >>> You are putting your prefix into the variable that is intended to hold the >>> name of the controller/model. >> >>> Try: >> >>> Model: >>> var $name = 'Campaign'; >>> var $useTable = 'campaign'; >>> var $tablePrefix = 'adb_'; >> >>> //ideally you'd call the table campaigns, then wouldn't need the $useTable >>> or tablePrefix variables >> >>> Controller: >>> var $name = 'Campaigns'; >> >>> I'd recommend getting rid of your $uses array because it will hit >>> performance - look up Associations-Linking-Models-Together. >> >>> Your view folder should be called campaigns. >> >>> The 'mycampaign.ctp' view you have created will be rendered when you access >>> the controller function 'mycampaign'. >> >>> Jeremy Burns >>> jeremybu...@me.com >> >>> On 30 Apr 2010, at 09:40, Master Ram wrote: >> HI. all i am new to cakephp >> i have table name called: adb_campaign >> my contorller is: my controller Name: compaigns_controller.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 >> >>> class Campaign extends AppModel { >> // var $tablePrefix = 'adb_'; var $useTable ='adb_' >> } ?> >> in the view folder name: campaign >> mycampaigns.ctp >> >>>$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+unsubscr...@googlegroups.com For more options, visit this group athttp://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+unsubscr...@googlegroups.com For more options, visit this group >>> athttp://groups.google.com/group/cake-php?hl=en >> >> Check o
Re: Table Naming convention problem
that is not my problem. who to use the table name in controller my table name is "adb_campaign"(we can not change the table) what is the model, view and controller and how to use it. thanks sir On Apr 30, 2:00 pm, Jeremy Burns wrote: > I was wrong about something - your view is called mycampaigns, not mycampaign > - sorry. However, it looks like you are getting back a list of campaigns > rather than just one. So I would change the function code to: > > function mycampaigns() { > $campaigns = $this->Campaign->find('all'); > $this->set('campaigns',$campaigns); > > } > > Notice the pluralisation of the the campaignS variable, which is what your > view is looking for. You can shorten it further too: > > function mycampaigns() { > $this->set( > 'campaigns', > $this->Campaign->find('all') > ); > > } > > Jeremy Burns > jeremybu...@me.com > (Skype) +44 208 123 3822 (jeremy_burns) > (m) +44 7973 481949 > (h) +44 208 530 7573 > > On 30 Apr 2010, at 09:53, Jeremy Burns wrote: > > > > > It is rarely a good idea to stray from conventions > > (http://book.cakephp.org/view/22/CakePHP-Conventions) if you can avoid it. > > Is it too late to re-factor your database? Assuming it is... > > > You are putting your prefix into the variable that is intended to hold the > > name of the controller/model. > > > Try: > > > Model: > > var $name = 'Campaign'; > > var $useTable = 'campaign'; > > var $tablePrefix = 'adb_'; > > > //ideally you'd call the table campaigns, then wouldn't need the $useTable > > or tablePrefix variables > > > Controller: > > var $name = 'Campaigns'; > > > I'd recommend getting rid of your $uses array because it will hit > > performance - look up Associations-Linking-Models-Together. > > > Your view folder should be called campaigns. > > > The 'mycampaign.ctp' view you have created will be rendered when you access > > the controller function 'mycampaign'. > > > Jeremy Burns > > jeremybu...@me.com > > > On 30 Apr 2010, at 09:40, Master Ram wrote: > > >> HI. all i am new to cakephp > > >> i have table name called: adb_campaign > > >> my contorller is: > >> my controller Name: compaigns_controller.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 > > >> >> class Campaign extends AppModel { > > >> // var $tablePrefix = 'adb_'; > >> var $useTable ='adb_' > > >> } > >> ?> > > >> in the view folder name: campaign > > >> mycampaigns.ctp > > >> >> $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+unsubscr...@googlegroups.com For more options, visit this group > >> athttp://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+unsubscr...@googlegroups.com For more options, visit this group > > athttp://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+unsubscr...@googlegroups.com For mo
Re: Table Naming convention problem
On Apr 30, 11:01 am, Master Ram wrote: > the table name is fixed i cont change the table name to "adb_compaign" Master Ram, Which is the correct name - you are using compaign and campaign indiscriminately. I'd suggest putting 'prefix' => 'adb_' in your db config file and baking the model, then the controller and then the views (it'll guarentee you have the right class names, file names and in the right/ conventional location) AD * http://book.cakephp.org/search/bake 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
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 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 wrote: > > HI. all i am new to cakephp > > > i have table name called: adb_campaign > > > my contorller is: > > my controller Name: compaigns_controller.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 > > > > class Campaign extends AppModel { > > > // var $tablePrefix = 'adb_'; > > var $useTable ='adb_' > > > } > > ?> > > > in the view folder name: campaign > > > mycampaigns.ctp > > > > $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+unsubscr...@googlegroups.comFor > > 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+unsubscr...@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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
I was wrong about something - your view is called mycampaigns, not mycampaign - sorry. However, it looks like you are getting back a list of campaigns rather than just one. So I would change the function code to: function mycampaigns() { $campaigns = $this->Campaign->find('all'); $this->set('campaigns',$campaigns); } Notice the pluralisation of the the campaignS variable, which is what your view is looking for. You can shorten it further too: function mycampaigns() { $this->set( 'campaigns', $this->Campaign->find('all') ); } Jeremy Burns jeremybu...@me.com (Skype) +44 208 123 3822 (jeremy_burns) (m) +44 7973 481949 (h) +44 208 530 7573 On 30 Apr 2010, at 09:53, Jeremy Burns wrote: > It is rarely a good idea to stray from conventions > (http://book.cakephp.org/view/22/CakePHP-Conventions) if you can avoid it. Is > it too late to re-factor your database? Assuming it is... > > You are putting your prefix into the variable that is intended to hold the > name of the controller/model. > > Try: > > Model: > var $name = 'Campaign'; > var $useTable = 'campaign'; > var $tablePrefix = 'adb_'; > > //ideally you'd call the table campaigns, then wouldn't need the $useTable or > tablePrefix variables > > Controller: > var $name = 'Campaigns'; > > I'd recommend getting rid of your $uses array because it will hit performance > - look up Associations-Linking-Models-Together. > > Your view folder should be called campaigns. > > The 'mycampaign.ctp' view you have created will be rendered when you access > the controller function 'mycampaign'. > > Jeremy Burns > jeremybu...@me.com > > > On 30 Apr 2010, at 09:40, Master Ram wrote: > >> HI. all i am new to cakephp >> >> i have table name called: adb_campaign >> >> my contorller is: >> my controller Name: compaigns_controller.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 >> >> > class Campaign extends AppModel { >> >> // var $tablePrefix = 'adb_'; >>var $useTable ='adb_' >> >> } >> ?> >> >> in the view folder name: campaign >> >> mycampaigns.ctp >> >> >$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 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+unsubscr...@googlegroups.com For more options, visit this group at >> http://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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
Looks like we all jumped on that one! Jeremy Burns jeremybu...@me.com On 30 Apr 2010, at 09:48, Ed Propsner wrote: > LOL, I was too late ... > > http://book.cakephp.org/view/903/Model-and-Database-Conventions > > On Fri, Apr 30, 2010 at 4:47 AM, Andrei Mita 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 wrote: > HI. all i am new to cakephp > > i have table name called: adb_campaign > > my contorller is: > my controller Name: compaigns_controller.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 > > class Campaign extends AppModel { > > // var $tablePrefix = 'adb_'; >var $useTable ='adb_' > > } > ?> > > in the view folder name: campaign > > mycampaigns.ctp > > $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 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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
It is rarely a good idea to stray from conventions (http://book.cakephp.org/view/22/CakePHP-Conventions) if you can avoid it. Is it too late to re-factor your database? Assuming it is... You are putting your prefix into the variable that is intended to hold the name of the controller/model. Try: Model: var $name = 'Campaign'; var $useTable = 'campaign'; var $tablePrefix = 'adb_'; //ideally you'd call the table campaigns, then wouldn't need the $useTable or tablePrefix variables Controller: var $name = 'Campaigns'; I'd recommend getting rid of your $uses array because it will hit performance - look up Associations-Linking-Models-Together. Your view folder should be called campaigns. The 'mycampaign.ctp' view you have created will be rendered when you access the controller function 'mycampaign'. Jeremy Burns jeremybu...@me.com On 30 Apr 2010, at 09:40, Master Ram wrote: > HI. all i am new to cakephp > > i have table name called: adb_campaign > > my contorller is: > my controller Name: compaigns_controller.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 > > class Campaign extends AppModel { > > // var $tablePrefix = 'adb_'; >var $useTable ='adb_' > > } > ?> > > in the view folder name: campaign > > mycampaigns.ctp > > $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 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+unsubscr...@googlegroups.com For more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
LOL, I was too late ... http://book.cakephp.org/view/903/Model-and-Database-Conventions On Fri, Apr 30, 2010 at 4:47 AM, Andrei Mita 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 wrote: > >> HI. all i am new to cakephp >> >> i have table name called: adb_campaign >> >> my contorller is: >> my controller Name: compaigns_controller.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 >> >> > class Campaign extends AppModel { >> >> // var $tablePrefix = 'adb_'; >>var $useTable ='adb_' >> >> } >> ?> >> >> in the view folder name: campaign >> >> mycampaigns.ctp >> >> >$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 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+unsubscr...@googlegroups.comFor >> more options, visit this group at >> http://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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Table Naming convention problem
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 wrote: > HI. all i am new to cakephp > > i have table name called: adb_campaign > > my contorller is: > my controller Name: compaigns_controller.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 > > class Campaign extends AppModel { > > // var $tablePrefix = 'adb_'; >var $useTable ='adb_' > > } > ?> > > in the view folder name: campaign > > mycampaigns.ctp > > $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 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Table Naming convention problem
HI. all i am new to cakephp i have table name called: adb_campaign my contorller is: my controller Name: compaigns_controller.php Campaign->find('all'); $this->set('campaign',$campaigns); } } ?> my modle Name: campaign.php in the view folder name: campaign mycampaigns.ctp 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 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Default routing - methods naming convention problem
Not very positive, but you would have to edit the core cake files, which you should never do. So you either have to deal with the someAction URL or just deal with writing it as some_action. Someone clarify if I am wrong. On Aug 31, 10:52 pm, Raph wrote: > Yes - I know. But I would like it to be "/some_controller/some_action" > without changing methods names. > > On 1 Wrz, 02:08, Miles J wrote: > > > Your URL would simply be /some_controller/someAction/. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Default routing - methods naming convention problem
Yes - I know. But I would like it to be "/some_controller/some_action" without changing methods names. On 1 Wrz, 02:08, Miles J wrote: > Your URL would simply be /some_controller/someAction/. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Default routing - methods naming convention problem
Your URL would simply be /some_controller/someAction/. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Default routing - methods naming convention problem
I would like to urls in my app were look like "/some_controller/ some_action". The problem is I use camel-case methods naming conventions, so I would have class "SomeControllerController" with method "someAction()". Actually I like this convention and I don't want to change it. In this case "/some_controller/some_action" won't work, because Cake it's going to seek "some_action()" method. How can I do this the way I want to? I think there is a mistake in docs. Look at http://book.cakephp.org/view/46/Routes-Configuration#Default-Routing-540 - it says (...)"and /products/view_clearance maps to the viewClearance () action"(..) but It dosen't work. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---