Skip to content

Instantly share code, notes, and snippets.

<?
$dir ="/home/bitrix/ext_www/host.svarbi.ru/upload/iblock/";
function optimizeimage($input,$output)
{
$images = new Imagick(glob($input));
foreach($images as $image) {
$image->stripimage();
$image->setImageCompression(Imagick::COMPRESSION_JPEG);
$image->setImageCompressionQuality(78);
@tentacode
tentacode / list.html.twig
Created October 15, 2012 12:23
Twig recursive macro
{% macro recursiveCategory(category) %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ _self.recursiveCategory(child) }}
{% endfor %}
</ul>