I'm developing a web app with Zend Framework 2.
I want to achieve urls with current locale automatically built-in, i.e. /locale/controller/action/etc. I wrote this:
<?php
$locale = new Zend_Locale();
?>
<ul class="nav">
<li>
<a href="/<?php echo $locale->getLanguage(); ?>/devices">Devices</a>
<ul>
<li>
<a href="/devices/add"><img src="img/navbar/add.png" alt="+"> Add</a>
</li>
</ul>
</li>
<li>
<a href="/<?php echo $locale->getLanguage(); ?>/favorites">Favorites</a>
<ul>
<li>
<a href="/favorites/add"><img src="img/navbar/add.png" alt="+"> Add</a>
</li>
</ul>
</li>
</ul>
and put it in a navbar.phtml file that i include in this way
include("navbar.phtml");
in my Application/view/layout/layout.phtml.
But, i only get this
Fatal error: Class 'Zend_Locale' not found in blabla\module\Application\view\layout\navbar.phtml on line 3
What's wrong? I forget some "use"? Sorry but i'm a newbie in php.
Zend_Locale
is a Zend1 method of localization. See: framework.zend.com/manual/2.2/en/index.html#zend-i18n – naththedeveloper