Я построил одну переменную (horaires_lundi) в этом файле:
Приложение / код / сообщества / Unirgy / StoreLocator / Контроллеры / Adminhtml / Locationcontroller.php
->setTitle($this->getRequest()->getParam('title'))
->setNotes($this->getRequest()->getParam('notes'))
->setStreetAddress($this->getRequest()->getParam('street_address'))
->setHorairesLundi($this->getRequest()->getParam('horaires_lundi'))
Все переменные хорошо отображаются в JavaScript в этом файле:
приложение / дизайн / интерфейс / по умолчанию / по умолчанию / шаблон / unirgy / storelocator / map.phtml
(function(){
var storeLocator = new UnirgyStoreLocator({
mapEl: $('map'),
sidebarEl: $('sidebar'),
searchUrl: '<?php echo $this->getUrl('ustorelocator/location/search')?>',
generateSidebarHtml: function(m) {
return '<span style="font-size:14px; color:#C68804;"><b>' + m.title + '</b></span><br/>(Distance : ' + parseFloat(m.distance).toFixed(1) + ' ' + m.units + ')<br/>'
+ m.street_address + ' ' + m.test + ' ' + m.city + '<br/><b>' + m.notes + '</b><br/>';
},
generateMarkerHtml: function(m) {
var url = m.website_url.replace(/\s/,'');
var dataForm = new VarienForm('form-validate', true);
return '<span style="font-size:14px; color:#C68804;">' + m.title + '</span><br/>'
+ '<?php if (trim($this->getHorairesLundi())!=""): ?>Lun '+ m.horaires_lundi +'<?php else : ?>No horaire lundi<br/><?php endif; ?>'
переменная m.horaires_lundi
в JavaScript хорошо отображается в веб-интерфейсе.
Но я не могу сделать условие в PHP для отображения m.horaires_lundi
, только если существует m.horaires_lundi
...
Выше я попробовал с
<?php if (trim($this->getHorairesLundi())!=""): ?>
Это метод Гуг? что еще я должен сделать?
Есть ли другой метод с чем-то вроде:
<?php if (Mage::helper(...
Я нашел учебник по Magento, но не могу найти свое решение.