Hi, I am new to Cake and I have a question.
For the file below (email.php), I do not understand where does the "render" in $this->controller->render($this->thtml) come from. $controller ($this->controller) is a variable whose domain is limited to this class. But it seems $this->controller is an object and it has a render function I searched the entire project and there are 3 render functions: The 1st is in app/controllers/components/output.php, the 2nd is in cake/libs/view/view.php the 3rd is in cake/libs/controller/controller.php For this class (EmailComponent), which render function does it really call? Why? The confusing part for me, why $this->controller is an object instead of a variable? I am using two different PHP IDE, after entering $this- >controller->, there is no code hint (if entering $this->, code hints will popup controller, for example). Additionally, I got to know the $html helper from cake's online tutorial. But where is $html declared? I cannot find it. Thanks, ---------------------------------------------------------------- App/controllers/components/email.php <?php /* * EmailComponent for CakePHP * * @author gwoo <[EMAIL PROTECTED]> * @version 0.10.5.1797 * @license OPPL * */ class EmailComponent extends Object { var $thtml; var $headers = null; var $to = null; var $from = null; var $subject = null; var $cc = null; var $bcc = null; var $controller; function message() { //Output buffer starts here ob_start(); $this->controller->render($this->thtml); //Get buffer content and clean buffer $mail = ob_get_clean(); return $mail; } function send() { $headers = $this->headers ."Content-Transfer-Encoding: quoted-printable\n" ."From: $this->from\n" ."Return-Path: $this->from\n" ."CC:$this->cc\n" ."BCC:$this->bcc\n"; $success = mail($this->to, $this->subject, $this->message(), $headers); return $success; } } ?> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---