get path to active theme

Submitted by remo - 6 years ago

When you work with assets in your theme, you'll often need the path to embed them. Here's how you can do that in your theme

// from a file which belongs to a theme (header.php, default.php ..)
echo '<img src="' . $this->getThemePath() . '/images/logo.png" alt="Ortic"/>';

// if you're not within a theme, you'll have to get the view instance first
$v = View::getInstance();
echo $v->getThemePath();
Stats Categories Tags
comments powered by Disqus