diff --git a/lib/mailpoet.php b/lib/mailpoet.php index a175ad6fb9..3220a8308c 100644 --- a/lib/mailpoet.php +++ b/lib/mailpoet.php @@ -165,6 +165,7 @@ class Initializer { public function admin_page() { // set data + $subscriber = new \MailPoet\Models\Subscriber(); $this->data = array( 'title' => __('Twig Sample page'), 'text' => 'Lorem ipsum dolor sit amet', @@ -172,7 +173,8 @@ class Initializer { 'users' => array( array('name' => 'Joo', 'email' => 'jonathan@mailpoet.com'), array('name' => 'Marco', 'email' => 'marco@mailpoet.com'), - ) + ), + 'subscriber' => $subscriber->name ); // Sample page using Twig echo $this->renderer->render('index.html', $this->data); diff --git a/lib/models/subscriber.php b/lib/models/subscriber.php new file mode 100644 index 0000000000..1e1d365e58 --- /dev/null +++ b/lib/models/subscriber.php @@ -0,0 +1,11 @@ +name = 'First Subscriber'; + } +} diff --git a/views/index.html b/views/index.html index 0349a7dfd7..d5c9673e50 100644 --- a/views/index.html +++ b/views/index.html @@ -25,10 +25,13 @@ {% endfor %} +

Autoloaded Subscriber

+

{{ subscriber }}

+

Notices

Trigger success

Trigger error

Trigger warning

-{% endblock %} \ No newline at end of file +{% endblock %}