luyadev/luya-mailjet

View on GitHub
src/admin/aws/MjmlPreviewActiveWindow.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace luya\mailjet\admin\aws;

use Yii;
use luya\admin\ngrest\base\ActiveWindow;

/**
 * Mjml Preview Active Window.
 *
 * @since 1.3.0
 */
class MjmlPreviewActiveWindow extends ActiveWindow
{
    /**
     * @var string The name of the module where the ActiveWindow is located in order to finde the view path.
     */
    public $module = '@mailjetadmin';

    /**
     * Default label if not set in the ngrest model.
     *
     * @return string The name of of the ActiveWindow. This is displayed in the CRUD list.
     */
    public function defaultLabel()
    {
        return 'Preview';
    }

    /**
     * Default icon if not set in the ngrest model.
     *
     * @var string The icon name from goolges material icon set (https://material.io/icons/)
     */
    public function defaultIcon()
    {
        return 'mail';
    }

    /**
     * The default action which is going to be requested when clicking the ActiveWindow.
     *
     * @return string The response string, render and displayed trough the angular ajax request.
     */
    public function index()
    {
        return $this->render('index', [
            'model' => $this->model,
        ]);
    }
}