hola, tengo un error en una aplicacion con cake
esta funcion recibe unos parametros y con ellos tengo que buscar un precio
private function
cambio_precio($producto_id=null,$producto_especial=null){
$listado = $this->ListadoPrecio->find('first',array(
'contain'=>false,
Hello Russell Brown,
You are use this code so this error not show again. Please add
this code "
set('address_list', $this->Address->find('all'));
}
}
?>
"
On Monday, October 15, 2012 7:58:52 PM UTC-4, Russell Brown wrote:
>
>
change your Controller
class AddressesController extends AppController {
public $uses = 'Address'; // or your model name for it
var_dump($this->Address->find('all', array('limit' => 10)));
}
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/C
This error implies that the $this->Address object is not available.
If there is no database connection, the Address model should still be
available on $this->Address and you would get a database connection error.
Just in case, try defining the $uses variable in your controller.
class Address
C-5, Russell Brown wrote:
>
>> Error: Call to a member function find() on a non-object
>> File: c:\wamp\www\cake222\app\**Controller\**AddressesController.php
>>
>> I get the error on the $this->set('address_list',
>> $this->Address->f
wrote:
>
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\cake222\app\Controller\AddressesController.php
>
> I get the error on the $this->set('address_list',
> $this->Address->find('all')) line below:
>
> Parti
gt; >> Here is my index.ctp view file in the View\Addresses folder:
>>>>>> >>
>>>>>> >> >>>>> >> echo $this->Html->link('Add New Address', array('action'=>'add'));
>>>>>> >> ?>
>>>>>> >>
;>
>>>>> >> Id
>>>>> >> First Name
>>>>> >> Last Name
>>>>> >> Email
>>>>> >> Phone
>>>>> >> Address
>>>>> >> Options
>>>&
>>>> >>
>>>> >> Id
>>>> >> First Name
>>>> >> Last Name
>>>> >> Email
>>>> >> Phone
>>>> >> Address
>>>> >> Options
>>>> >>
>>>> >>
>>>> >> Id
>>>> >> First Name
>>>> >> Last Name
>>>> >> Email
>>>> >> Phone
>>>> >> Address
>>>> >> Options
>>>> &g
) {
>>> >> $address = $line['Address'];
>>> >> echo
>>> >> ''.
>>> >> ''.$address['id'].''.
>>> >> ''.$this->Html->link($**address['first_name
h ( $address_list as $line ) {
>> >> $address = $line['Address'];
>> >> echo
>> >> ''.
>> >> ''.$address['id'].''.
>> >> ''.$this->Html->link($**address['first_name'],
>> array('action'=>'v
ddress = $line['Address'];
> >> echo
> >> ''.
> >> ''.$address['id'].''.
> >> ''.$this->Html->link($address['first_name'],
> array('action'=>'view',
> >>
s['id'])).''.
>> ''.$address['last_name'].''.
>> ''.$address['email'].''.
>> ''.$address['phone'].''.
>> ''.$address['address'].'
gt;> ''.$address['last_name'].'**'.
>> ''.$address['email'].''.
>> ''.$address['phone'].''.
>> ''.$address['address'].''.
>> ''.$this->
#x27;'.$address['last_name'].''.
> ''.$address['email'].''.
> ''.$address['phone'].''.
> ''.$address['address'].''.
> ''.$this->Html->link('edit', arr
I can't get debug($this) to work in Cake 2.2.2.
It may be different in Cake 2.2.2 but I haven't been able to figure it out.
I have installed the DebugKit plugin.
On Thursday, October 18, 2012 12:36:00 PM UTC-5, jsundquist wrote:
>
> The error has nothing to do with your view. It will have to d
The error has nothing to do with your view. It will have to do with either
your model or your controller. As people have previously stated can you do
a debug($this) before and after your find? It will show if the Address
model is actually loaded or not. If its not loaded then your find method
wi
Ok. I changed the index.ctp as shown in the pertinent section of code as
follows (but I still get the same error):
foreach ( $address_list as $line ) {
$address = $line['Address'];
echo
''.
''.$address[0]['id'].''.
/* ''.$this->Html->link($address['first_name'],
array('action'=>'view', 'id'
Pull your Array
you may need to change
''.$address['id'].''.
to
''.$address[0]['id'].''.
or something like that
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Group
7;.
> ''.$address['phone'].''.
> ''.$address['address'].''.
> ''.$this->Html->link('edit',
> array('action'=>'edit',
Here is what the routes.php file looks like:
'addresses', 'action'
=> 'index'));
?>
On Monday, October 15, 2012 6:58:52 PM UTC-5, Russell Brown wrote:
>
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\cake222\app\Con
'.
''.$address['phone'].''.
''.$address['address'].''.
''.$this->Html->link('edit', array('action'=>'edit',
'id'=>$address['id'])).' '.
$this->Html->link('del
On Monday, October 15, 2012 6:58:52 PM UTC-5, Russell Brown wrote:
>
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\cake222\app\Controller\AddressesController.php
>
> I get the error on the $this->set('address_list',
> $t
change it to: var $name = 'Address';
>
> Andras Kende
> http://www.kende.com
>
> On Oct 15, 2012, at 4:58 PM, Russell Brown
> >
> wrote:
>
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\cake222\app\Controller\AddressesControl
15, 2012 7:38:32 PM UTC-5, cricket wrote:
>
> That all looks good to me. Try deleting the files in app/tmp/cache/models
>
> With PHP5.x you don't need the line var $name = 'addresses';
>
> On Mon, Oct 15, 2012 at 7:58 PM, Russell Brown
> >
> wrote:
> &g
the line var $name = 'addresses';
>
> On Mon, Oct 15, 2012 at 7:58 PM, Russell Brown
> >
> wrote:
> > Error: Call to a member function find() on a non-object
> > File: c:\wamp\www\cake222\app\Controller\AddressesController.php
> >
> > I get t
try to comment out
> var $name = 'addresses';
or change it to: var $name = 'Address';
Andras Kende
http://www.kende.com
On Oct 15, 2012, at 4:58 PM, Russell Brown wrote:
> Error: Call to a member function find() on a non-object
> File: c:\wa
Yes, the contents of my Address model is:
> Will you also dump your model file contents
>
> On Mon, Oct 15, 2012 at 7:58 PM, Russell Brown
>
> > wrote:
>
>> Error: Call to a member function find() on a non-object
>> File: c:\wamp\www\cake222\app\Controller\Ad
That all looks good to me. Try deleting the files in app/tmp/cache/models
With PHP5.x you don't need the line var $name = 'addresses';
On Mon, Oct 15, 2012 at 7:58 PM, Russell Brown wrote:
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\c
Will you also dump your model file contents
On Mon, Oct 15, 2012 at 7:58 PM, Russell Brown wrote:
> Error: Call to a member function find() on a non-object
> File: c:\wamp\www\cake222\app\Controller\AddressesController.php
>
> I get the error on the $this->set('address_lis
Error: Call to a member function find() on a non-object
File: c:\wamp\www\cake222\app\Controller\AddressesController.php
I get the error on the $this->set('address_list',
$this->Address->find('all')) line below:
Partial listing of my AddressesController fil
No problem. Sometimes it helps to have another person look at it :)
--
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 th
Ohhh thanks I miss this part now it works.
Ing. Reynier Pérez Mira
http://reynierpm.site90.com/
On Thu, Feb 23, 2012 at 5:48 PM, jeremyharris wrote:
> It's because the item Country does not exist on Information. Models are
> always singular, so where you have Countries defined in your Informa
It's because the item Country does not exist on Information. Models are
always singular, so where you have Countries defined in your Information
belongsTo you should have Country instead.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new Cak
a User model. ;-)
>>>>>
>>>>> But I didn't change anything in the source code except replacing the
>>>>> cake folder with the newest version.
>>>>>
>>>>> On Wed, Sep 22, 2010 at 1:56 PM, Jeremy Burns | Class Outfit
>
;>> wrote:
>>>>> Do you have a User model?
>>>>>
>>>>> Jeremy Burns
>>>>> Class Outfit
>>>>>
>>>>> jeremybu...@classoutfit.com
>>>>> http://www.classoutfit.com
>>>>>
>>&
assoutfit.com
>>>> http://www.classoutfit.com
>>>>
>>>> On 22 Sep 2010, at 12:53, psybear83 wrote:
>>>>
>>>>> Hi everybody
>>>>>
>>>>> I have overtaken a CakePHP application which used an out-dated ve
t;>
>>> On 22 Sep 2010, at 12:53, psybear83 wrote:
>>>
>>>> Hi everybody
>>>>
>>>> I have overtaken a CakePHP application which used an out-dated version
>>>> of CakePHP (1.2.0.x), so I upgraded it to 1.2.8. Everything
rtaken a CakePHP application which used an out-dated version
>>> of CakePHP (1.2.0.x), so I upgraded it to 1.2.8. Everything worked
>>> fine before, but now I have problems with HABTM relations:
>>>
>>> $authors = $this->Medium->Author->find('
.0.x), so I upgraded it to 1.2.8. Everything worked
>> fine before, but now I have problems with HABTM relations:
>>
>> $authors = $this->Medium->Author->find('list', array('order' =>
>> 'Author.name'));
>>
>> results in
>
it to 1.2.8. Everything worked
> fine before, but now I have problems with HABTM relations:
>
> $authors = $this->Medium->Author->find('list', array('order' =>
> 'Author.name'));
>
> results in
>
> Fatal error: Call to a member fu
7;order' =>
'Author.name'));
results in
Fatal error: Call to a member function find() on a non-object in /
Users/josh/Sites/ziviapps/app/controllers/media_controller.php on line
57
My models:
class Author extends AppModel {
var $name = 'Author';
var $hasAndBelo
43 matches
Mail list logo