AcMailer\Service\MailService::setDefaultLayout PHP 메소드

setDefaultLayout() 공개 메소드

Sets the default layout to be used with all the templates set when calling setTemplate.
public setDefaultLayout ( AcMailer\View\DefaultLayoutInterface $layout = null ) : mixed
$layout AcMailer\View\DefaultLayoutInterface
리턴 mixed
    public function setDefaultLayout(DefaultLayoutInterface $layout = null)
    {
        $this->defaultLayout = isset($layout) ? $layout : new DefaultLayout();
    }

Usage Example

예제 #1
0
 public function testWithDefaultLayout()
 {
     $resolver = new TemplatePathStack();
     $resolver->addPath(__DIR__ . '/../../view');
     $this->mailService->getRenderer()->setResolver($resolver);
     $model = new ViewModel();
     $model->setTemplate('ac-mailer/mail-templates/layout.phtml');
     $this->mailService->setDefaultLayout(new DefaultLayout($model));
     $this->mailService->setTemplate('ac-mailer/mail-templates/mail.phtml');
     $this->assertInstanceOf('Zend\\Mime\\Message', $this->mailService->getMessage()->getBody());
 }
All Usage Examples Of AcMailer\Service\MailService::setDefaultLayout