How to display variables in the other .tpl opencart 2?

When you create a popup in the header file.tpl displays an error
<!-- entrance -->
 <div id="enter_modal" class="modal_box mfp-with-anim mfp-hide">
 <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
the <h3>login</h3>
 <input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control">
 <input type="password" name="password" value="<?php echo $password; ?>" placeholder="<?php echo $entry_password; ?>" id="input-password" class="form-control">
 <input type="submit" value="<?php echo $button_login; ?>" class="btn btn-primary">
 <a href="#register_modal" class="open-popup-link" data-effect="mfp-zoom-in">log in</a>
 <a href="#">Forgot password?</a>

Undefined variable: email in /home/u932152297/public_html/catalog/view/theme/myasotmpl/template/common/header.tpl on line 140


how to move to make the ability of using variables in other files .tpl standard?
July 8th 19 at 16:19
1 answer
July 8th 19 at 16:21
// variables
$data['action'] = $this->url->link('account/login', ", 'SSL');
if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} else {
$data['email'] = ";

if (isset($this->request->post['password'])) {
$data['password'] = $this->request->post['password'];
} else {
$data['password'] = ";
$data['button_login'] = $this->language->get('button_login');

Find more questions by tags OpenCartPHPSmarty