How's Joomla Module getting a Web site?



  • In the module, I get a simple code with a picture, and I want to get a way to the template when I write that.

    <?php
    defined( '_JEXEC') or die('Restricted access');
    $app = JFactory::getApplication();
    $template_url = $this->baseurl . '/templates/' . $this->template;
    ?>
    <img src="<? echo $logo; ?>/images/blocks_services_im1.png"/>
    

    That makes a mistake. Fatal error: Using $this when not in object context in How do you get this way? Please.



  • Thank you all for your help, I found a decision myself, maybe someone could use it.

    defined( '_JEXEC') or die('Restricted access');
    $app = JFactory::getApplication();
    $template = $app->getTemplate();
    $template_url = JURI::root(true).'/templates/'.$template.'/';
    

    <img src="<? echo $template_url; ?>/images/blocks_services_im1.png"/>


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2