<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1867002802603307029</id><updated>2024-08-29T02:14:08.805+03:00</updated><category term="magento"/><category term="zf1"/><category term="мадженто"/><category term="filter"/><category term="rewrite"/><category term="Magento 2.0"/><category term="code"/><category term="config"/><category term="controller"/><category term="event"/><category term="git"/><category term="layout"/><category term="mail"/><category term="observer"/><category term="zf"/><category term="админ"/><category term="ошибка"/><category term="1.9"/><category term="MultiCheckbox"/><category term="WYSIWYG"/><category term="acl"/><category term="add"/><category term="addAttributeToFilter"/><category term="admin"/><category term="all product attributes"/><category term="api"/><category term="attribute"/><category term="base64"/><category term="bitbucket"/><category term="bootstrap"/><category term="cache"/><category term="change config"/><category term="clear"/><category term="cms"/><category term="collection"/><category term="column"/><category term="compare float numbers"/><category term="create table"/><category term="curl"/><category term="db"/><category term="debug"/><category term="delete product"/><category term="email"/><category term="error"/><category term="events"/><category term="exception"/><category term="external js"/><category term="external run"/><category term="fallback"/><category term="filterable attributes"/><category term="footer"/><category term="get qty"/><category term="github"/><category term="global messages"/><category term="google adwords"/><category term="google tag manager"/><category term="grub2"/><category term="gtm"/><category term="header"/><category term="helper"/><category term="hooks git хуки"/><category term="htaccess"/><category term="html"/><category term="html5"/><category term="https"/><category term="installer"/><category term="jquery"/><category term="js"/><category term="laravel"/><category term="locale"/><category term="localization"/><category term="log"/><category term="magento 1.7"/><category term="magento 1.8"/><category term="magento 1.8.1"/><category term="magento 1.9"/><category term="magento 1.x"/><category term="magento compare"/><category term="magerun"/><category term="move category"/><category term="page"/><category term="page type"/><category term="pagination"/><category term="php"/><category term="phpstorm"/><category term="request"/><category term="response"/><category term="responsive design"/><category term="rewrite route"/><category term="send"/><category term="server"/><category term="setStoreId"/><category term="slirx"/><category term="ssh"/><category term="ssl"/><category term="store filter"/><category term="tabs"/><category term="third party libraries"/><category term="tier price"/><category term="updates"/><category term="url"/><category term="vdi"/><category term="virtualbox"/><category term="where"/><category term="zend framework"/><category term="атрибут"/><category term="внешнее исполнение кода"/><category term="импорт товаров"/><category term="ключи"/><category term="контроллер"/><category term="очистка кэша"/><category term="ошибка css не найден"/><category term="параметр"/><category term="пароль"/><category term="переопределение"/><category term="получить атрибуты"/><category term="путь к css"/><category term="путь к js"/><category term="разработка"/><category term="редактор"/><category term="сайт"/><category term="событие"/><category term="события"/><category term="ссылка"/><category term="удаление продукта"/><title type='text'>Magento developer</title><subtitle type='html'>Magento 2.0, Magento 1.x, php, css, js, linux &amp;amp; other stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default?start-index=26&amp;max-results=25'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-1848865893435167668</id><published>2016-07-07T20:19:00.002+03:00</published><updated>2016-07-07T20:19:16.750+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="js"/><category scheme="http://www.blogger.com/atom/ns#" term="magento 1.x"/><title type='text'>Change javascript order in magento 1.x</title><content type='html'>To change order of javascript files you need to add &quot;params&quot; tag to your xml layout:

&lt;pre class=&quot;xml&quot;&gt;&lt;code&gt;&amp;lt;action method=&quot;addItem&quot;&amp;gt;
&amp;lt;type&amp;gt;js&amp;lt;/type&amp;gt;
&amp;lt;name&amp;gt;path/to/js.js&amp;lt;/name&amp;gt;
&amp;lt;params&amp;gt;&amp;lt;![CDATA[name=&quot;zz_new_name&quot;]]&amp;gt;&amp;lt;/params&amp;gt;
&amp;lt;/action&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/1848865893435167668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2016/07/change-javascript-order-in-magento-1x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1848865893435167668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1848865893435167668'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2016/07/change-javascript-order-in-magento-1x.html' title='Change javascript order in magento 1.x'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-6094889473004530992</id><published>2015-10-30T10:12:00.001+02:00</published><updated>2016-06-16T21:10:38.069+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="external js"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><title type='text'>How to add external js to magento</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Add to your layout:
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;xml&quot;&gt;&amp;lt;reference name=&quot;head&quot;&amp;gt;
   &amp;lt;block type=&quot;core/text&quot; name=&quot;my.external.js&quot;&amp;gt;
      &amp;lt;action method=&quot;setText&quot;&amp;gt;
        &amp;lt;text&amp;gt;
           &amp;lt;![CDATA[&amp;lt;script type=&quot;text/javascript&quot; src=&quot;https://domain.com/my_file.js&quot;&amp;gt;&amp;lt;/script&amp;gt;]]&amp;gt;
        &amp;lt;/text&amp;gt;
      &amp;lt;/action&amp;gt;
   &amp;lt;/block&amp;gt;
&amp;lt;/reference&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/6094889473004530992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-add-external-js-to-magento.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/6094889473004530992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/6094889473004530992'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-add-external-js-to-magento.html' title='How to add external js to magento'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-8955475468100576933</id><published>2015-10-29T11:57:00.000+02:00</published><updated>2016-06-17T23:40:47.806+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="global messages"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><title type='text'>How to show global messages in own controller/block</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Add to your controller:
&lt;pre&gt;
&lt;code class=&quot;php&quot;&gt;$this-&gt;_initLayoutMessages(&#39;customer/session&#39;);&lt;/code&gt;&lt;/pre&gt;
after loadLayout():
&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;$this-&gt;loadLayout();
$this-&gt;_initLayoutMessages(&#39;customer/session&#39;);
$this-&gt;renderLayout();&lt;/code&gt;&lt;/pre&gt;
Then in phtml:
&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&amp;lt;?= $this-&gt;getMessagesBlock()-&gt;toHtml() ?&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/8955475468100576933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-show-global-messages-in-own.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8955475468100576933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8955475468100576933'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-show-global-messages-in-own.html' title='How to show global messages in own controller/block'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-342576748347877316</id><published>2015-10-15T12:53:00.001+03:00</published><updated>2015-10-15T12:53:27.613+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="create table"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><title type='text'>How to create table in magento installation script</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;
$installer = $this;

$installer-&gt;startSetup();

$table = $installer-&gt;getConnection()
    -&gt;newTable($installer-&gt;getTable(&#39;wmpayment/webmoney_response&#39;))
    -&gt;addColumn(&#39;id&#39;, Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        &#39;identity&#39; =&gt; true,
        &#39;unsigned&#39; =&gt; true,
        &#39;nullable&#39; =&gt; false,
        &#39;primary&#39;  =&gt; true,
    ), &#39;Id&#39;)
    -&gt;addColumn(&#39;id_order&#39;, Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        &#39;unsigned&#39; =&gt; true,
        &#39;nullable&#39; =&gt; false
    ), &#39;Id order&#39;)
    -&gt;addColumn(&#39;response&#39;, Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
        &#39;nullable&#39; =&gt; false,
    ), &#39;Response in json format&#39;)
    -&gt;addIndex(&#39;id_order&#39;, &#39;id_order&#39;);
$installer-&gt;getConnection()-&gt;createTable($table);
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/342576748347877316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-create-table-in-magento.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/342576748347877316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/342576748347877316'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-create-table-in-magento.html' title='How to create table in magento installation script'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-5492217927925668311</id><published>2015-10-15T10:51:00.001+03:00</published><updated>2015-10-15T10:51:11.781+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="config"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><title type='text'>How to get magento config value</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$value = Mage::getStoreConfig(&#39;path/to/config&#39;);
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/5492217927925668311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-get-magento-config-value.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5492217927925668311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5492217927925668311'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/10/how-to-get-magento-config-value.html' title='How to get magento config value'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-5291960206517745296</id><published>2015-10-06T11:50:00.000+03:00</published><updated>2015-10-06T11:50:17.268+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="change config"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><title type='text'>Change magento configuration programmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$configModel = Mage::getModel(&#39;core/config&#39;);
$configModel-&gt;saveConfig(&#39;path/to/config&#39;, &#39;new value&#39;);
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/5291960206517745296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/10/change-magento-configuration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5291960206517745296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5291960206517745296'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/10/change-magento-configuration.html' title='Change magento configuration programmatically'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-926724193852266809</id><published>2015-08-19T16:37:00.001+03:00</published><updated>2015-08-19T16:37:45.947+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rewrite route"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>How to use regex route rewrite in zf1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Just add construction like this to your config file:
&lt;pre name=&quot;code&quot; class=&quot;xml&quot;&gt;
resources.router.routes.exhange.type = &quot;Zend_Controller_Router_Route_Regex&quot;
resources.router.routes.exhange.route = &quot;([a-zA-Z0-9]+)-to-([a-zA-Z0-9]+).html&quot;
resources.router.routes.exhange.defaults.module = default
resources.router.routes.exhange.defaults.controller = index
resources.router.routes.exhange.defaults.action = exchange
resources.router.routes.exhange.map.1 = &quot;from&quot;
resources.router.routes.exhange.map.2 = &quot;to&quot;
&lt;/pre&gt;
Then you will be able to use links like: /one-to-two.html, where $_GET[&#39;from&#39;] will be &quot;one&quot; and $_GET[&#39;to&#39;] - &quot;two&quot;.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/926724193852266809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/08/how-to-use-regex-route-rewrite-in-zf1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/926724193852266809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/926724193852266809'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/08/how-to-use-regex-route-rewrite-in-zf1.html' title='How to use regex route rewrite in zf1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-8380737332052672259</id><published>2015-07-15T13:08:00.000+03:00</published><updated>2015-07-15T13:08:52.676+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="compare float numbers"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>How to compare float numbers in php</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;
/**
 * Return true if $a equals to $b
 *
 * @param float $a
 * @param float $b
 *
 * @return bool
 */
function isEqualFloat($a, $b)
{
    $epsilon = 0.00001;

    if (abs($a - $b) &lt; $epsilon) {
        return true;
    }

    return false;
}
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/8380737332052672259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/07/how-to-compare-float-numbers-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8380737332052672259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8380737332052672259'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/07/how-to-compare-float-numbers-in-php.html' title='How to compare float numbers in php'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-5482592521642653259</id><published>2015-04-03T14:14:00.001+03:00</published><updated>2015-04-03T14:14:41.540+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bootstrap"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>How to create table in bootstrap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Add this code:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$this-&gt;bootstrap(&#39;db&#39;);
$db = $this-&gt;getResource(&#39;db&#39;);
Zend_Registry::set(&#39;db&#39;, $db);
&lt;/pre&gt;
after
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
parent::__construct($application);
&lt;/pre&gt;
in your bootstrap constructor.
&lt;br&gt;
And then you can create table:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$tableAuthSession = new Application_Model_DbTable_AuthSession();
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/5482592521642653259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/04/how-to-create-table-in-bootstrap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5482592521642653259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5482592521642653259'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/04/how-to-create-table-in-bootstrap.html' title='How to create table in bootstrap'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-5515586353134192393</id><published>2015-03-24T17:03:00.000+02:00</published><updated>2015-03-24T17:03:21.305+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="where"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>How to group WHERE clause in zf1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$db = $this-&gt;getAdapter();
$select = $db-&gt;select();
$select-&gt;from($this-&gt;_name);

$select-&gt;where(&#39;ip = ?&#39;, &#39;120.0.0.1&#39;);
$select-&gt;orWhere(&#39;login = ?&#39;, &#39;test&#39;);

$subQuery = $select-&gt;getPart(Zend_Db_Select::WHERE);
$select-&gt;reset(Zend_Db_Select::WHERE);
$select-&gt;where(implode(&#39; &#39;, $subQuery));
$select-&gt;where(&#39;created_at = ?&#39;, date(&#39;Y-m-d&#39;));

$res = $select-&gt;query()-&gt;fetchAll();
&lt;/pre&gt;
This will create sql with WHERE clause like as: &quot;((ip = &#39;127.0.0.1&#39;) OR (login = &#39;test&#39;)) AND (created_at = &#39;2015-03-24&#39;)&quot;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/5515586353134192393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/03/how-to-group-where-clause-in-zf1.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5515586353134192393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5515586353134192393'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/03/how-to-group-where-clause-in-zf1.html' title='How to group WHERE clause in zf1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-3742868404559257070</id><published>2015-02-23T20:41:00.000+02:00</published><updated>2015-02-23T20:41:26.321+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="helper"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><category scheme="http://www.blogger.com/atom/ns#" term="Magento 2.0"/><title type='text'>Get helper from template (.phtml) in magento 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Let&#39;s imagine that you have a helper app/code/SliRx/News/Helper/Date.php.&lt;br/&gt;
You can get the helper from template (.phtml file) like this:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$helper = $this-&gt;helper(&#39;SliRx\News\Helper\Date&#39;);
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/3742868404559257070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/02/get-helper-from-template-phtml-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3742868404559257070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3742868404559257070'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/02/get-helper-from-template-phtml-in.html' title='Get helper from template (.phtml) in magento 2.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-7148842417902118167</id><published>2015-02-22T00:47:00.000+02:00</published><updated>2015-02-22T00:47:20.325+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="layout"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><category scheme="http://www.blogger.com/atom/ns#" term="Magento 2.0"/><title type='text'>Changing page layout in magento 2.0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
You can change page layout by adding:
&lt;pre  class=&quot;php&quot; name=&quot;code&quot;&gt;
$layout = &#39;2columns-left&#39;;
$this-&gt;pageConfig-&gt;setPageLayout($layout);
&lt;/pre&gt;
to your block&#39;s constructor.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/7148842417902118167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/02/changing-page-layout-in-magento-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7148842417902118167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7148842417902118167'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/02/changing-page-layout-in-magento-20.html' title='Changing page layout in magento 2.0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-7538965157605569155</id><published>2015-02-13T22:32:00.000+02:00</published><updated>2015-08-19T16:59:57.659+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google tag manager"/><category scheme="http://www.blogger.com/atom/ns#" term="gtm"/><category scheme="http://www.blogger.com/atom/ns#" term="magento"/><category scheme="http://www.blogger.com/atom/ns#" term="magento 1.7"/><category scheme="http://www.blogger.com/atom/ns#" term="magento 1.8"/><category scheme="http://www.blogger.com/atom/ns#" term="magento 1.8.1"/><category scheme="http://www.blogger.com/atom/ns#" term="magento 1.9"/><title type='text'>Magento google tag manager gtm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Google Tag Manager integration&lt;/h2&gt;
With Google Tag Manager you can manage your Analytics events, Adwords 
conversion tracking, remarketing, etc. in one place. This module allows 
you to integrate Google Tag Manager to your site.
&lt;br /&gt;
All you need is insert your container id to configuration of this extension.&lt;br /&gt;
&lt;h3&gt;
&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;
You can get &lt;span style=&quot;color: red;&quot;&gt;&lt;a href=&quot;http://www.magentocommerce.com/magento-connect/google-tag-manager-integration.html&quot;&gt;Google Tag Manager Integration GTM for magento here&lt;/a&gt;&lt;/span&gt; &lt;/h3&gt;
&lt;h3&gt;
&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;
Where to configure the extension?&lt;/h3&gt;
System &amp;gt; Configuration &amp;gt; Google Tag Manager &amp;gt; Configuration.


&lt;br /&gt;
&lt;h3&gt;
Extension features:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Support multi-store&lt;/li&gt;
&lt;li&gt;Support transactions (ecommerce tracking)&lt;/li&gt;
&lt;li&gt;Support remarketing&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Transaction features:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Support all product types&lt;/li&gt;
&lt;li&gt;You can specify a name of your shop for each store&lt;/li&gt;
&lt;/ul&gt;
Remarketing allows you to show ads to your past site visitors and 
customize those ads based on the section of your site people visited. 
With dynamic remarketing, you can take this a step further, and show 
your site visitors an ad with the specific product they viewed on your 
site.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/7538965157605569155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2015/02/magento-google-tag-manager-gtm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7538965157605569155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7538965157605569155'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2015/02/magento-google-tag-manager-gtm.html' title='Magento google tag manager gtm'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-1583291382308608044</id><published>2014-11-18T13:32:00.002+02:00</published><updated>2014-11-18T13:32:55.727+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="base64"/><category scheme="http://www.blogger.com/atom/ns#" term="mail"/><title type='text'>Sending email via mail function in base64</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$messsage = base64_encode($message);
$send = mail($address, &quot;=?utf-8?B?&quot;.base64_encode($subject).&quot;?=&quot;, $message, &quot;Content-type:text/plain; charset=UTF-8\r\nContent-Transfer-Encoding: base64&quot;);
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/1583291382308608044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/sending-email-via-mail-function-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1583291382308608044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1583291382308608044'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/sending-email-via-mail-function-in.html' title='Sending email via mail function in base64'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-5511065107199548044</id><published>2014-11-18T13:14:00.001+02:00</published><updated>2014-11-18T13:14:51.197+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="locale"/><category scheme="http://www.blogger.com/atom/ns#" term="mail"/><title type='text'>How to set subject with &quot;ru&quot; locale in mail function (for utf-8)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$subject = &quot;Тема сообщения&quot;;
$subject = &quot;=?utf-8?B?&quot;.base64_encode($subject).&quot;?=&quot;;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/5511065107199548044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/how-to-set-subject-with-ru-locale-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5511065107199548044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/5511065107199548044'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/how-to-set-subject-with-ru-locale-in.html' title='How to set subject with &quot;ru&quot; locale in mail function (for utf-8)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-2133142536311951643</id><published>2014-11-09T15:16:00.000+02:00</published><updated>2014-11-09T15:16:30.184+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="acl"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>Access control list (ACL) in zend framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For implementing ACL you have to create class, in which will be created roles, resources and settings permissions.
For this reason add to application/configs/application.ini:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
autoloadernamespaces.app = &quot;App_&quot;
&lt;/pre&gt;
And create file library/App/Acl.php:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
/**
 * Class App_Acl
 */
class App_Acl extends Zend_Acl
{
    function __construct()
    {
        $defaultResource = new Zend_Acl_Resource(&#39;default&#39;);
        $adminResource = new Zend_Acl_Resource(&#39;admin&#39;);

        $this-&gt;addResource($adminResource);
        $this-&gt;addResource($defaultResource);

        // guest/client resources
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;index&#39;), $defaultResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;payment&#39;), $defaultResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;panel&#39;), $defaultResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;user&#39;), $defaultResource);

        // admin resources
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;admin_user&#39;), $adminResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;admin_exchange&#39;), $adminResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;admin_rate&#39;), $adminResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;admin_eps&#39;), $adminResource);
        $this-&gt;addResource(new Zend_Acl_Resource(&#39;admin_page&#39;), $adminResource);

        $this-&gt;addRole(new Zend_Acl_Role(App_Acl_Roles::GUEST));
        $this-&gt;addRole(new Zend_Acl_Role(App_Acl_Roles::CLIENT), App_Acl_Roles::GUEST);
        $this-&gt;addRole(new Zend_Acl_Role(App_Acl_Roles::ADMIN), App_Acl_Roles::CLIENT);

        $this-&gt;deny();

        $this-&gt;allow(App_Acl_Roles::GUEST, &#39;index&#39;);
        $this-&gt;allow(App_Acl_Roles::GUEST, &#39;payment&#39;);
        $this-&gt;allow(App_Acl_Roles::CLIENT, &#39;user&#39;);
        $this-&gt;allow(App_Acl_Roles::CLIENT, &#39;panel&#39;);

        // Allow all to administrator
        $this-&gt;allow(App_Acl_Roles::ADMIN);
    }

    /**
     * Check if user has permission to the requested resource
     *
     * @param null $resource
     * @param null $privilege
     *
     * @return bool Return true if user has permission
     */
    public static function checkPermissions($resource = null, $privilege = null)
    {
        $acl = new App_Acl();

        $auth = Zend_Auth::getInstance()-&gt;getIdentity();

        $role = App_Acl_Roles::GUEST;

        if (isset($auth-&gt;role) &amp;&amp; $auth-&gt;role) {
            $role = $auth-&gt;role;
        }

        return $acl-&gt;isAllowed($role, $resource, $privilege);
    }
}
&lt;/pre&gt;
Note: your auth instance must contains &#39;role&#39; property.&lt;br&gt;
Then create file library/App/Acl/Roles.php:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
/**
 * Class App_Acl_Roles
 */
class App_Acl_Roles
{
    const ADMIN = &#39;admin&#39;;
    const CLIENT = &#39;client&#39;;
    const GUEST = &#39;guest&#39;;
}
&lt;/pre&gt;
From this moment you can add to your controller:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
public function preDispatch()
{
  parent::preDispatch();

  if (!App_Acl::checkPermissions($this-&gt;getRequest()-&gt;getModuleName())) {
      $this-&gt;redirect(&#39;/login&#39;);
  }
}
&lt;/pre&gt;
And if user doesn&#39;t have permissions to the controller - it will be redirected to the login page or whatever you want.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/2133142536311951643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/access-control-list-acl-in-zend.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/2133142536311951643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/2133142536311951643'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/access-control-list-acl-in-zend.html' title='Access control list (ACL) in zend framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-3888211110128180820</id><published>2014-11-08T13:44:00.000+02:00</published><updated>2014-11-08T13:52:55.149+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exception"/><category scheme="http://www.blogger.com/atom/ns#" term="log"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>Writing errors/exceptions to a log file in zend framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Add to application.ini
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
resources.log.stream.writerName = &quot;Stream&quot;
resources.log.stream.writerParams.stream = APPLICATION_PATH &quot;/data/logs/application.log&quot;
resources.log.stream.writerParams.mode = &quot;a&quot;
resources.log.stream.filterName = &quot;Priority&quot;
resources.log.stream.filterParams.priority = 5
&lt;/pre&gt;
Add method to application/Bootstrap.php:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
/**
* Error handler
*
* @param $errno
* @param $errstr
* @param $errfile
* @param $errline
*
* @throws ErrorException
*/
public function exceptionErrorHandler($errno, $errstr, $errfile, $errline)
{
  throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
}
&lt;/pre&gt;
and to constructor in the same file:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
set_error_handler([$this, &#39;exceptionErrorHandler&#39;]);
&lt;/pre&gt;
Then in application/controllers/ErrorController.php. Find method &quot;errorAction&quot; and replace:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$log-&gt;log($this-&gt;view-&gt;message, $priority, $errors-&gt;exception);
$log-&gt;log(&#39;Request Parameters&#39;, $priority, $errors-&gt;request-&gt;getParams());
&lt;/pre&gt;
with
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$logMessage = $errors-&gt;exception-&gt;getMessage() . PHP_EOL .
    $errors-&gt;exception-&gt;getTraceAsString() . PHP_EOL .
    &#39;Request Parameters:&#39; . PHP_EOL .
    var_export($errors-&gt;request-&gt;getParams(), true) . PHP_EOL .
    str_repeat(&#39;-&#39;, 50) . PHP_EOL;
$log-&gt;log($logMessage, $priority, $errors-&gt;exception);
&lt;/pre&gt;
And in the same file change $priority = Zend_Log::CRIT; to $priority = Zend_Log::NOTICE;&lt;br&gt;
Don&#39;t forget to create application/data/logs/application.log and set writing permissions to it. Exceptions will be written to this file.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/3888211110128180820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/writing-errorsexceptions-to-log-file-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3888211110128180820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3888211110128180820'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/writing-errorsexceptions-to-log-file-in.html' title='Writing errors/exceptions to a log file in zend framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-4158158432254500958</id><published>2014-11-06T12:17:00.002+02:00</published><updated>2014-11-06T12:17:44.853+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="https"/><category scheme="http://www.blogger.com/atom/ns#" term="ssl"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>How to enable ssl/https in zend framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Add this to application/Bootstrap.php:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;protected function _initForceSSL() {
    if($_SERVER[&#39;SERVER_PORT&#39;] != &#39;443&#39;) {
        header(&#39;Location: https://&#39; . $_SERVER[&#39;HTTP_HOST&#39;] . $_SERVER[&#39;REQUEST_URI&#39;]);
        exit();
    }
}
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/4158158432254500958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/how-to-enable-sslhttps-in-zend.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/4158158432254500958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/4158158432254500958'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/how-to-enable-sslhttps-in-zend.html' title='How to enable ssl/https in zend framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-4285830667753024648</id><published>2014-11-04T20:41:00.001+02:00</published><updated>2014-11-04T20:41:40.895+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="localization"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>Localization in zend framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In zf1 you can localize text, date, numbers and many other.&lt;br /&gt;
First of all you have to create folders for each locale. E.g. for russian locale: application/languages/ru_RU/, where ru - locale, RU - country.&lt;br /&gt;
Then you can create files with translations. As example create FormLabel.csv in your ru_RU folder:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;&quot;Login:&quot;;&quot;Логин:&quot;
&quot;Password:&quot;;&quot;Пароль:&quot;
&quot;Password confirmation:&quot;;&quot;Подтверждение пароля:&quot;
&quot;First name:&quot;;&quot;Имя:&quot;
&quot;Last name:&quot;;&quot;Фамилия:&quot;
&lt;/pre&gt;
Also you need to add locale initialization to your bootstrap file (application/Bootstrap.php):
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;protected function _initTranslate()
{
  $locale = new Zend_Locale(&#39;ru_RU&#39;);
  $registry = Zend_Registry::getInstance();
  $registry-&amp;gt;set(&#39;Zend_Locale&#39;, $locale);

  $translate = new Zend_Translate(Zend_Translate::AN_CSV, APPLICATION_PATH . &#39;/languages&#39;, null,
      [&#39;scan&#39; =&amp;gt; Zend_Translate::LOCALE_DIRECTORY]);

  $registry-&amp;gt;set(&#39;Zend_Translate&#39;, $translate);
}
&lt;/pre&gt;
From this moment localization will be enabled and if you create form with label &quot;Login:&quot; it&#39;ll be displayed as &quot;Логин:&quot;.&lt;br /&gt;
But if you want to handy translate text in your templates add this function
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;function __()
{
    return Zend_Registry::get(&#39;Zend_Translate&#39;)-&amp;gt;translate(func_get_args());
}
&lt;/pre&gt;
after
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;require_once &#39;Zend/Application.php&#39;;
&lt;/pre&gt;
to public/index.php.&lt;br /&gt;
And then in your phtml you can translate text:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;&amp;lt;?= __(&#39;Password:&#39;) ?&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/4285830667753024648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/11/localization-in-zend-framework-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/4285830667753024648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/4285830667753024648'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/11/localization-in-zend-framework-1.html' title='Localization in zend framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-1375682190961235726</id><published>2014-10-30T19:54:00.001+02:00</published><updated>2014-10-30T19:54:59.951+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pagination"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>Creating pagination in zf1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For creating pagination in zend framework 1 you have to perform several steps:&lt;br /&gt;
1) Set up pagination template.&lt;br /&gt;
Create file application/views/scripts/pagination.phtml:&lt;br /&gt;
&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;&amp;lt;div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ul class=&quot;pagination&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php if (isset($this-&amp;gt;previous)): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;?= $this-&amp;gt;url(array(&#39;page&#39; =&amp;gt; $this-&amp;gt;first)); ?&amp;gt;&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;amp;laquo;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php else: ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li class=&quot;disabled&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;amp;laquo;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endif; ?&amp;gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php if (isset($this-&amp;gt;previous)): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;?= $this-&amp;gt;url(array(&#39;page&#39; =&amp;gt; $this-&amp;gt;previous)); ?&amp;gt;&quot;&amp;gt;&amp;amp;larr;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php else: ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li class=&quot;disabled&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;amp;larr;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endif; ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Numbered page links --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php foreach ($this-&amp;gt;pagesInRange as $page): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php if ($page != $this-&amp;gt;current): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;?= $this-&amp;gt;url(array(&#39;page&#39; =&amp;gt; $page)); ?&amp;gt;&quot;&amp;gt;&amp;lt;?= $page; ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php else: ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li class=&quot;active&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;lt;?= $page; ?&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endif; ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endforeach; ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Next page link --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php if (isset($this-&amp;gt;next)): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;?= $this-&amp;gt;url(array(&#39;page&#39; =&amp;gt; $this-&amp;gt;next)); ?&amp;gt;&quot;&amp;gt;&amp;amp;rarr;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php else: ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li class=&quot;disabled&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;amp;rarr;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endif; ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- Last page link --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php if (isset($this-&amp;gt;next)): ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;a href=&quot;&amp;lt;?= $this-&amp;gt;url(array(&#39;page&#39; =&amp;gt; $this-&amp;gt;last)); ?&amp;gt;&quot;&amp;gt;&amp;amp;raquo;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php else: ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li class=&quot;disabled&quot;&amp;gt;&amp;lt;span&amp;gt;&amp;amp;raquo;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endif; ?&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
2) Create an instance of Zend_Paginator with paginator adapter.&lt;br /&gt;
For instance, you can create method getPaginator in your table model:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;/**
 * Class Application_Model_DbTable_Task
 */
class Application_Model_DbTable_Task extends Zend_Db_Table_Abstract
{
    protected $_name = &#39;task&#39;;
    protected $_rowClass = &#39;Application_Model_Task&#39;;

    public function getPaginator(array $where = [])
    {
        $db = $this-&amp;gt;getAdapter();
        $select = $db-&amp;gt;select();
        $select-&amp;gt;from($this-&amp;gt;_name);

        foreach ($where as $key =&amp;gt; $value) {
            $select-&amp;gt;where($key, $value);
        }

        $select-&amp;gt;order(&#39;created_at DESC&#39;);

        $adapter = new Zend_Paginator_Adapter_DbSelect($select);
        $paginator = new Zend_Paginator($adapter);

        return $paginator;
    }
}
&lt;/pre&gt;
and in your controller:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;$user = Application_Model_User::getCurrent();
$tableTask = new Application_Model_DbTable_Task();
$paginator = $tableTask-&amp;gt;getPaginator([&#39;id_user = ?&#39; =&amp;gt; $user-&amp;gt;id]);

$page = $this-&amp;gt;getRequest()-&amp;gt;getParam(&#39;page&#39;, 1);
$paginator-&amp;gt;setCurrentPageNumber($page);
$config = $this-&amp;gt;getInvokeArg(&#39;bootstrap&#39;)-&amp;gt;getOptions();
$paginator-&amp;gt;setItemCountPerPage($config[&#39;pagination&#39;][&#39;per_page&#39;]);

$this-&amp;gt;view-&amp;gt;paginator = $paginator;
&lt;/pre&gt;
3) Configure pagination in settings file and in your bootstrap.&lt;br /&gt;
Add to application.ini:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;pagination.per_page = 10
&lt;/pre&gt;
and in bootstrap:
&lt;br /&gt;
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;protected function _initPagination()
{
    Zend_Paginator::setDefaultScrollingStyle(&#39;Sliding&#39;);
    Zend_View_Helper_PaginationControl::setDefaultViewPartial(
        &#39;pagination.phtml&#39;
    );
}
&lt;/pre&gt;
4) Print pagination html.&lt;br /&gt;
Add in view template:&lt;br /&gt;
&lt;pre class=&quot;html&quot; name=&quot;code&quot;&gt;&amp;lt;?php if (count($this-&amp;gt;paginator)): ?&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php foreach ($this-&amp;gt;paginator as $item): ?&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;item&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?= $item[&#39;value&#39;] ?&amp;gt; (&amp;lt;?= $item[&#39;state&#39;] ?&amp;gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;?php endforeach; ?&amp;gt;&lt;br /&gt;&amp;lt;?php else: ?&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;empty&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nothing is found.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;?php endif; ?&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?= $this-&amp;gt;paginator ?&amp;gt; &lt;br /&gt;
&lt;/pre&gt;
where $item - a row from db
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/1375682190961235726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/10/creating-pagination-in-zf1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1375682190961235726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1375682190961235726'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/10/creating-pagination-in-zf1.html' title='Creating pagination in zf1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-1511400315402443406</id><published>2014-10-30T12:09:00.001+02:00</published><updated>2014-10-30T12:14:49.007+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MultiCheckbox"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>Multi checkbox or multiselect in zend framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For creating a form with multi checkboxes you can add to your form:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$possibleExchange = $this-&gt;createElement(&#39;MultiCheckbox&#39;, &#39;possible_exchange&#39;);
$possibleExchange-&gt;setRequired(true)-&gt;setLabel(&#39;MyTitle&#39;)-&gt;addMultiOptions($items);
&lt;/pre&gt;
then in populating the form you have to do something like that:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$populateData = $epsCurrencyItem-&gt;toArray();
$populateData[&#39;possible_exchange&#39;] = explode(&#39;,&#39;, $populateData[&#39;possible_exchange&#39;]);
$form-&gt;populate($populateData);
&lt;/pre&gt;
this is needed for selecting checkboxes.&lt;br&gt;
And when you save data to db you have to:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$data[&#39;possible_exchange&#39;] = implode(&#39;,&#39;, $data[&#39;possible_exchange&#39;]);
$epsCurrencyItem-&gt;setFromArray($data);
$epsCurrencyItem-&gt;save();
&lt;/pre&gt;

Similarly you can use multiselect. Difference will be only when you create the form:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$possibleExchange = $this-&gt;createElement(&#39;multiselect&#39;, &#39;possible_exchange&#39;);
$possibleExchange-&gt;setRequired(true)
   -&gt;setLabel(&#39;MyTitle&#39;)
   -&gt;setAttrib(&#39;size&#39;, 10)
   -&gt;addMultiOptions($items);
&lt;/pre&gt;

&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/1511400315402443406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/10/multi-checkbox-in-zend-framework-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1511400315402443406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/1511400315402443406'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/10/multi-checkbox-in-zend-framework-1.html' title='Multi checkbox or multiselect in zend framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-2301211016098534750</id><published>2014-08-30T11:02:00.000+03:00</published><updated>2014-08-30T11:02:40.759+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="curl"/><category scheme="http://www.blogger.com/atom/ns#" term="request"/><category scheme="http://www.blogger.com/atom/ns#" term="zf"/><title type='text'>Sending POST/GET request with Zend Framework 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For POST request:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$data = [
 &#39;login&#39; =&gt; &#39;admin&#39;,
 &#39;password&#39; =&gt; &#39;pass&#39;,
];
$client = new Zend_Http_Client(&#39;https://your.URL&#39;);
$client-&gt;setMethod(Zend_Http_Client::POST);
$client-&gt;setParameterPost($data);
$json = $client-&gt;request()-&gt;getBody();
&lt;/pre&gt;
For GET request:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$client = new Zend_Http_Client(&#39;https://blahblahblah.blah&#39;);
$client-&gt;setMethod(Zend_Http_Client::GET);
$client-&gt;request();
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/2301211016098534750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/08/sending-postget-request-with-zend.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/2301211016098534750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/2301211016098534750'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/08/sending-postget-request-with-zend.html' title='Sending POST/GET request with Zend Framework 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-7397786722131799770</id><published>2014-08-30T10:31:00.003+03:00</published><updated>2014-08-30T15:05:11.229+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="config"/><category scheme="http://www.blogger.com/atom/ns#" term="zf"/><title type='text'>Get config in zf 1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
From controller:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$config = $this-&gt;getInvokeArg(&#39;bootstrap&#39;)-&gt;getOptions();
&lt;/pre&gt;
then $config is associative array
&lt;br&gt;
From other places:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
$config = Zend_Controller_Front::getInstance()-&gt;getParam(&#39;bootstrap&#39;)-&gt;getOptions();
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/7397786722131799770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/08/get-config-in-zf-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7397786722131799770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/7397786722131799770'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/08/get-config-in-zf-1.html' title='Get config in zf 1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-3179147717141430582</id><published>2014-08-22T21:58:00.002+03:00</published><updated>2014-08-22T21:58:55.910+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="zend framework"/><category scheme="http://www.blogger.com/atom/ns#" term="zf1"/><title type='text'>How to add own class to library in ZF1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
You have to add to your application.ini:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
autoloadernamespaces.broker = &quot;Broker_&quot;
&lt;/pre&gt;
where Broker is your directory into library folder. As a result you can create class Broker_Object in /library/Broker/Object.php and it will be loaded by autoloader.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/3179147717141430582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/08/how-to-add-own-class-to-library-in-zf1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3179147717141430582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/3179147717141430582'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/08/how-to-add-own-class-to-library-in-zf1.html' title='How to add own class to library in ZF1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1867002802603307029.post-8718509047414940541</id><published>2014-08-14T14:24:00.002+03:00</published><updated>2014-08-14T14:24:45.901+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="magento compare"/><title type='text'>How to add compare link to top links</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
First of all you have to create helper in your own module with two methods:
&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;
/**
 * Return label for comparing products list
 *
 * @return int
 */
public function getCompareLabel()
{
    $count = Mage::helper(&#39;catalog/product_compare&#39;)-&gt;getItemCollection()-&gt;getSize();
    return $this-&gt;__(&#39;Compare (%s)&#39;, $count);
}

/**
 * Return whether visible compare link
 *
 * @return bool
 */
public function getCompareLinkIsVisibleClass()
{
    $count = Mage::helper(&#39;catalog/product_compare&#39;)-&gt;getItemCollection()-&gt;getSize();

    if ($count &gt; 0) {
        return &#39;&#39;;
    }

    return &#39;class=&quot;no-display&quot;&#39;;
}
&lt;/pre&gt;
Then add to layout xml (in block where you want to add link):
&lt;pre class=&quot;xml&quot; name=&quot;code&quot;&gt;
&lt;action method=&quot;addLink&quot; translate=&quot;label title&quot; module=&quot;slirx_ajaxpanel&quot;&gt;
 &lt;label helper=&quot;slirx_ajaxpanel/getCompareLabel&quot;/&gt;
 &lt;url helper=&quot;catalog/product_compare/getListUrl&quot;/&gt;
 &lt;title&gt;Compare&lt;/title&gt;
 &lt;prepare/&gt;
 &lt;urlParams/&gt;
 &lt;position /&gt;
 &lt;liParams helper=&quot;slirx_ajaxpanel/getCompareLinkIsVisibleClass&quot; /&gt;
 &lt;aParams&gt;class=&quot;compare&quot;&lt;/aParams&gt;
&lt;/action&gt;
&lt;/pre&gt;
Where helper=&quot;slirx_ajaxpanel - your helper, module=&quot;slirx_ajaxpanel&quot; - your module.&lt;br&gt;&lt;br&gt;
And in app.js (for rwd theme, for another you have to add this code to any js file that will be loaded on pages with your compare link)
&lt;pre class=&quot;js&quot; name=&quot;code&quot;&gt;
$j(&#39;body&#39;).delegate(&#39;#header-account .compare&#39;, &#39;click&#39;, function(event) {
 var _url = $j(this).attr(&#39;href&#39;);
 popWin(_url, &#39;compare&#39;, &#39;top:0,left:0,width=820,height=600,resizable=yes,scrollbars=yes&#39;);

 event.preventDefault();
});
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://slirx.blogspot.com/feeds/8718509047414940541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://slirx.blogspot.com/2014/08/how-to-add-compare-link-to-top-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8718509047414940541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1867002802603307029/posts/default/8718509047414940541'/><link rel='alternate' type='text/html' href='http://slirx.blogspot.com/2014/08/how-to-add-compare-link-to-top-links.html' title='How to add compare link to top links'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/16100280413819570529</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>