Implemented method to set layout and template.

This commit is contained in:
Juan Basso 2011-03-01 18:16:55 -03:00
parent 131a62f9cb
commit bd5e5376d1

View file

@ -112,14 +112,14 @@ class CakeEmail {
*
* @var string
*/
public $layout = 'default';
protected $_layout = 'default';
/**
* Template for the view
*
* @var string
*/
public $template = null;
protected $_template = '';
/**
* as per RFC2822 Section 2.1.1
@ -584,6 +584,20 @@ class CakeEmail {
return $return;
}
/**
* Set the layout and template
*
* @param string $layout
* @param string $template
* @return void
*/
public function setLayout($layout, $template = null) {
$this->_layout = (string)$layout;
if ($template !== null) {
$this->_template = (string)$template;
}
}
/**
* Send an email using the specified content, template and layout
*