Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Например, class User extends COntroller
- $data = ['var' => 'Exapmle'];
- $this->view->showView('home', $data);
- // В конструкторе Controller
- $this->view = new View();
- // HTML код
- <?php if ((класс User->)isLogged()): ?>
- <a href="/profile/">Profile</a>
- <?php endif; ?>
- <?php if (Error::isError()): ?>Возникла ошибка.<?php endif; ?>
- // В контроллере
- $data = ['error' => Error::show(), 'user' => $this->user->getUserData()];
- $this->view->showView('user/sing_up', $data);
- // Во вью
- <?php if (!empty($error)): ?>
- <p style="color: #f00000;"><?php echo $error; ?></p>
- <?php endif; ?>
- <?php if ($user): ?>
- <a href="/profile/">Profile</a>
- <?php endif; ?>
Add Comment
Please, Sign In to add comment