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

  • SEARCH
  • Home
  • 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 8098821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:11:44+00:00 2026-06-05T22:11:44+00:00

I am using Code Igniter, The HMVC library , and Smarty with this library

  • 0

I am using Code Igniter, The HMVC library, and Smarty with this library.

Smarty is working fine by default, however if I try to use smarty’s inheritance feature ( {extends file="master.tpl"}) then we run into an issue.

The extends feature does not look in the module views folder for the extended file (in the above’s case master.tpl), instead it only looks in the application/views/ folder and throws an error if it cannot find it.

I could add APPPATH."modules/smartytest/views" to the $config['template_directory'] array in the smarty config file. but that throws an error for each item in the array it checks first for the file. filemtime(): stat failed for application/views/master.tpl

and that has the added issue of, if I have three modules all the the array and the modules all have a master.tpl then no matter what module I call the extend from it will load the first one found.

So, is there a way to get smarty’s extend function to behave nicely with the HMVC modules?

  • 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-05T22:11:46+00:00Added an answer on June 5, 2026 at 10:11 pm

    Ah, found a working solution,

    in My_Parser.php edit the block at line 30 so it reads:

    // Modular Separation / Modular Extensions has been detected
    if (method_exists( $this->CI->router, 'fetch_module' ))
    {
        $this->_module  = $this->CI->router->fetch_module();
        //add the current module view folder as a template directory
        if ($this->_module !== '')
            $this->CI->smarty->addTemplateDir(APPPATH."modules/".$this->_module.'/views');
    }
    

    The one drawback of this method is that smarty will look in your application/views folder before the module views folder. if someone knows a solution to that then it would be fantastic.

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

Sidebar

Related Questions

I have enabled google Minify in code igniter using this library on our website.
When you are using code igniter you load a library or model like so
I'm trying to write a daemon process using code igniter library, and the problem
I am using codeigniter. I defined a library in code-igniter and is expecting a
I'm using xampp for my php. And I have download a code igniter and
I have some problems using Code Igniter and I feel there is something I
I am using php with code igniter. I am designing a website with php.
I am trying to design a user registration form using code igniter 2.1.0. I
I am so confused right now, I am using code igniter php framework and
I am using the standard code igniter profiling functionality to view performance breakdown for

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.