Re: How to edit a view in Cake php

2013-06-19 Thread Ravinder Kaur
Table Products have a foreign key 'product_family_id' and have belongs to relationship with Product_families table. Table Product_families have foreign key 'customer_id' and have belongs to relationship with Customers table. Now How can i connect Product model and Customer model to have customer n

Re: How to edit a view in Cake php

2013-06-19 Thread Ravinder Kaur
Yes I have model for all my tables.. On Tue, Jun 18, 2013 at 7:25 PM, Eric Haskins wrote: > Do you have a Customers Model? I have models for all of my tables > > > > > On Monday, June 17, 2013 5:38:40 PM UTC-4, Raks wrote: > >> Returns an Error >> >> {"code":500,"url":"\/products\**/listing_dat

Re: How to edit a view in Cake php

2013-06-18 Thread Eric Haskins
Do you have a Customers Model? I have models for all of my tables On Monday, June 17, 2013 5:38:40 PM UTC-4, Raks wrote: > > Returns an Error > > {"code":500,"url":"\/products\/listing_data.json","name":"Call to a member > function find() on a non-object"} > > > > On Mon, Jun 17, 2013 at 1:26

Re: How to edit a view in Cake php

2013-06-17 Thread Ravinder Kaur
Returns an Error {"code":500,"url":"\/products\/listing_data.json","name":"Call to a member function find() on a non-object"} On Mon, Jun 17, 2013 at 1:26 PM, Gaurav Matta wrote: > If you only want name of customers then you can add public $uses= > array('product','customer'); as a datamember

Re: How to edit a view in Cake php

2013-06-17 Thread Ravinder Kaur
Adding public $uses= array('product','customer'); in controller data member.. gives an error 500. On Mon, Jun 17, 2013 at 1:26 PM, Gaurav Matta wrote: > If you only want name of customers then you can add public $uses= > array('product','customer'); as a datamember in your controller class > > A

Re: How to edit a view in Cake php

2013-06-17 Thread Gaurav Matta
If you only want name of customers then you can add public $uses= array('product','customer'); as a datamember in your controller class And you can use $this->customer->find('all') in ur action Let me know if this helps On 17-Jun-2013 11:08 PM, "Raks" wrote: > Have added a new Column... but m n

Re: How to edit a view in Cake php

2013-06-17 Thread Eric Haskins
Not sure how your getting your *$products *array You could use a $products = $this->{Model}->find('all',array( 'joins' => array( array( 'table' => 'customers', 'alias' => 'CustomerJoin', 'type' => 'INNER', 'conditions' => array(

Re: How to edit a view in Cake php

2013-06-17 Thread Raks
Have added a new Column... but m not able to get a column data from other model. I want name from customers table in products view.ctp. here's the view code: * array('title' => $product['Product']['model'], 'id' => $product['Product']['id']), 'Product.part_num' => $prod

How to edit a view in Cake php

2013-06-07 Thread Raks
Hi, I Have a piece of code having view, model and controller . I nee dto make changes to view only not in the database. So how can i do that. Do I need to edit model and controller as well. I am new to Cakephp and MVC framework too. Thanks. -- Like Us on FaceBook https://www.facebook.com