W
W
wanderbit2016-06-06 12:11:13
PHP
wanderbit, 2016-06-06 12:11:13

How to output variables in another .tpl opencart 2?

When creating a pop-up window in the header.tpl file, an error is displayed

<!--  вход -->
            <div id="enter_modal" class="modal_box mfp-with-anim mfp-hide">
                <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
                    <h3>вход</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">Регистрация</a>
                    <a href="#">Забыли пароль?</a>
                </form >
            </div>

Undefined variable: email in /home/u932152297/public_html/catalog/view/theme/myasotmpl/template/common/header.tpl on line 140
$password
$email
$button_login
$action
how to migrate to make it possible to use variables in other .tpl files, other than standard?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wanderbit, 2016-06-06
@wanderbit

// login 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');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question