@param string|array $view
@param array        $data
@param \Closure     $callback
@param null         $message

@return \Bogardo\Mailgun\Http\Response
182464
public function send($view, array $data, Closure $callback, $message = null)
    {
        $this->message = $message ?: new Message($this->mailgun->MessageBuilder(), $this->config);

        $this->callMessageBuilder($callback, $this->message);
        $this->renderBody($view, $data);

        $message = $this->message->getMessage();
        $files = $this->message->getFiles();

        $domain = $this->config->get('mailgun.domain');
        $response = new Response($this->mailgun->post("{$domain}/messages", $message, $files));

        return $response;
    }
626694
protected function renderSuccessPage(array $data, ?string $view = null) : View
    {
        return $this->view->make($view ?? 'state.success')->with($data);
    }
287155
public function output($view, array $data = null)
	{
		$response = new Response($this->render($view, $data), Response::HTTP_OK, ['Content-Type' => 'text/html']);
		$response->send();
	}
798610
public function success($message = null, $data = array(), $return = false)
    {
        if (!empty($data)) {
            foreach ($data as $key => $value) {
                $this->add($key, $value);
            }
        }
        $json = $this->jsonEncode(
            array(
                'success' => true,
                'message' => $message,
                'data' => $this->_data,
            )
        );
        if (!$return) {
            echo $json;
            Yii::app()->end();
        } else {
            return $json;
        }
    }
1373604
public function view($view, $data = [], $mergeData = [])
    {
        return $this->app['view']->make($this->viewname($view), $data, $mergeData);
    }
979764
protected function view($view, $data = [])
    {
        return parent::view($view, $data)
            ->with('settings', settings())
            ->with('banners', $this->getBanners())
            ->with('popularPages', $this->popularPages)
            ->with('showPageBanner', $this->showPageBanner)
            ->with('activePageTiers', $this->activePageTiers)
            ->with('footerNavigation', $this->footerNavigation)
            ->with('navigationFeatured', $this->navigationFeatured);
    }
1190254
public function render($data = [], $view = null)
    {
        $view = $view ? : MenuManager::PLUGIN_NAME . '::master_menu';

        return $this->manager->getView()->make($view, ['menu' => $this], $data)
            ->render();
    }
158290
public function later($time, $view, array $data, Closure $callback)
    {
        $message = new Message($this->mailgun->MessageBuilder(), $this->config);
        $message->builder()
                ->setDeliveryTime($this->parseTime($time), $this->config->get('app.timezone', 'UTC'));

        return $this->send($view, $data, $callback, $message);
    }
973596
public function outputView(array $data, $view = null)
    {
        if ($this->controller->requestType !== Macro::HTTP_REQUEST) {
            throw new Exception('$this->outputView not support '. $this->controller->requestType);
        }

        $this->setContentType('text/html; charset=UTF-8');
        if (empty($view)) {
            $view = str_replace('\\', '/', $this->getContext()->getControllerName()) . '/' .
                str_replace($this->getConfig()->get('http.method_prefix', 'action'), '', $this->getContext()->getActionName());
        }

        $responseBody = null;
        $found = false;
        $engine = getInstance()->templateEngine;
        $viewResolvePaths = getInstance()->viewResolvePaths;

        foreach ($viewResolvePaths as $basePath) {
            $template = $engine->setDirectory($basePath)->make($view);
            if (!$template->exists()) {
                continue;
            }
            $responseBody = $template->render($data);
            $found = true;
            break;
        }
        if (!$found) {
            throw new Exception(sprintf('A template named %s was not found in any folder, please check again', $view));
        }
        $this->end($responseBody);
    }
791953
public static function make( $view, $data = [], $mergeData = [] )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
1171888
public function loadView($view, $data = array(), $mergeData = array())
    {
	$view = View::make($view, $data, $mergeData);

	return $this->loadHTML($view);
    }
1188687
public function run($view, $data = array())
    {
        return parent::run(
            $view,
            \array_merge(View::get_additional_data($view, $data), $data)
        );
    }
86346
protected function view($view, $data = [], $auto_filter = null)
	{
		return \View::forge($view, $data, $auto_filter);
	}
732940
public function view(string $view, array $data = []) : Mail
  {
    $this->viewLocation = $view;
    $this->viewArgs = $data;
    return $this;
  }
799600
public function send($toEmail, $toName, $subject, $view, array $data = array(), $options = null)
    {
        $this->mail->queue($view, $data, function ($message) use ($toEmail, $toName, $subject, $options) {

            $message->to($toEmail, $toName)
                    ->subject($subject);

            // Allow the caller to run additional functions
            // on the $msg SwiftMailer object (cc, bcc, attach, ...)
            if ($options && is_callable($options)) {
                call_user_func($options, $message);
            }
        });
    }
1019972
public function display($view, $data = array(), $charset = null)
    {
        echo $this->get($view, $data, $charset);
    }
588584
public function render($view, array $data = [])
    {
        // Get Body-Template
        $template = $this->getTemplate($view);

        // extend with default data
        $data += $this->data;

        // set tags
        foreach ($data as $name => $value) {
            $template->tag($name, $value);
        }

        // Render Page
        return $this->applyFunctions(get_maintemplate((string)$template));
    }