Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:23:30+00:00 2026-06-15T19:23:30+00:00

I am developing a module Abc for PrestaShop 1.5 This is my dir 23/10/2012

  • 0

I am developing a module Abc for PrestaShop 1.5
This is my dir

23/10/2012  18:23             1.307 index.php
07/12/2012  18:27    <DIR>          tpl
               -> tpl dir:
               07/12/2012  18:27    <DIR>          .
               07/12/2012  18:27    <DIR>          ..
               07/12/2012  18:39               543 form.tpl
07/12/2012  18:36             4.507 abc.php

this is the code i use:

class Abc extends Module
{
    public function getContent()
    {
             return $this->display(dirname(__FILE__), 'tpl/form.tpl');
        }
...
}

however when i use smarty {debug} to print all variables

i don’t get the variables {img_dir} or {shop_name} like i should according to The official documentation.

I am confused of where to place the template, where the theme, and so on. I only need backoffice(backend) pages. What am i doing wrong?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:23:31+00:00Added an answer on June 15, 2026 at 7:23 pm

    Smarty variables have global scope. It means that they can be assigned in one file and you will be able to use anywhere and during all life cycle of your script. This way, when you fire hook or use your own tpl on frontend, no matter which controller you use, most likely (although there can be exception for overriding controller) method FrontController::init() will be excecuted. In this method most of these global smarty variables are assigned(http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module#CreatingaPrestaShopmodule-UsingSmarty):

    $assign_array = array(
        'img_ps_dir' => _PS_IMG_,
        'img_cat_dir' => _THEME_CAT_DIR_,
        'img_lang_dir' => _THEME_LANG_DIR_,
        'img_prod_dir' => _THEME_PROD_DIR_,
        'img_manu_dir' => _THEME_MANU_DIR_,
        'img_sup_dir' => _THEME_SUP_DIR_,
        'img_ship_dir' => _THEME_SHIP_DIR_,
        'img_store_dir' => _THEME_STORE_DIR_,
        'img_col_dir' => _THEME_COL_DIR_,
        'img_dir' => _THEME_IMG_DIR_,
        'css_dir' => _THEME_CSS_DIR_,
        'js_dir' => _THEME_JS_DIR_,
        'pic_dir' => _THEME_PROD_PIC_DIR_
    ); 
    

    Using hook in admin panel, FrontController::init() are not excecuted, and that’s way you need to assign all these variables in order to use them inside your files.

    But anywhere in admin panel you can use module_dir and module_template_dir which are assigned in method Module::display().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a module in PHP for Prestashop and I'm having a tough time
In a module I am developing, I am using the following code. function mymodule_page_alter(&$page)
I'am developing a module for Drupal which provides a login form and after submission
I'm developing a quiz module for a school with php and mysql. The requirements
I am developing a module which has a jQuery script with some AJAX code.
I am developing a chat module with JavaScript and php+mysql and I am storing
Sorry for my poor English. I'm developing a Prestashop module to list services in
I'm developing C module for php under linux and I'm trying to find a
I am developing email queue module for my php application. So all emails(user notifications,
I'm developing a custom module for Drupal 6, that creates a simple form. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.