Actually I have managed my emails through database. And there for I have
created one common function in App Controller class from where it is
included the Myemail model and retrive data from database on the base of
passed email ID. So some of my email goes from the website admin side, like
when admin activate user services. So at that time I have no problem in
email sending. But some of my emails are going through my automatic cron
job. which are added in app/vender/shell folder. But I want to use the App
controller common function from that place for sending the my emails from
the app/vender/shell folder script. So for that I have import the app
controller class and created the object of that class. And called the common
function which I have wrote in the app controller for sending the email from
the cron job. But my problem is that app controller included sucessfully
also its common method called sucessfully but the code in common function
which get the email data from the database using below code is not working
and gives the below error. I have added 
var $uses = array('Myemail'); code in the app controller and then used the
below method for getting the email data from the database.

Please ask if you required any other information. 

Please reply .. I am waiting your reply. As I am new to cakephp..

Thanks,
Jitendra

Sam-208 wrote:
> 
> Have you instantiated the Myemail model? AFAIK App::Import basically
> includes the php file... to get an instance of the class you still
> need to do something along the lines of
> 
>  $this->Myemail = new Myemail
> 
> Also, make sure you have the model name correct(since if your table
> was my_emails, cake would expect your model to be MyEmail)
> 
> On Jun 11, 8:20 am, "jitendra.rathod" <[email protected]>
> wrote:
>> Notice: Undefined property: AppController::$Myemail in
>> /var/www/app/app_controller.php on line 55
>>
>> here Myemail is the my model name and I am calling AppController method
>> from
>> app/vendors/shell/xyz.php file.
>>
>> I had write below three line code in starting of my xyz.php file
>>
>> App::import('Core', 'Controller');
>> App::import('Controller', 'app_');
>> App::import('Model', 'Myemail');
>>
>> this error shows on my below AppController file sentence.
>>
>> $arrEmail = $this->Myemail->findById($intEmailid);
>>
>> Plz reply ASAP. Waiting for reply.
>>
>> Thanks,
>> Jitendra
>> --
>> View this message in
>> context:http://old.nabble.com/used-model-in-AppController-gives-error-in-vend...
>> Sent from the CakePHP mailing list archive at Nabble.com.
> 
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
> 
> 

-- 
View this message in context: 
http://old.nabble.com/used-model-in-AppController-gives-error-in-vendor-shells-xyz.php-file.-tp28855063p28875775.html
Sent from the CakePHP mailing list archive at Nabble.com.

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to