Skip to content

Instantly share code, notes, and snippets.

public function diamondAction() {
/**
* Lets assume only one extra param is being passed for now
*/
$params = $this->getRequest()->getParams();
Mage::register('cmstemplate_navigation/grid', array("diamond",key($params)));
$this->loadLayout()->renderLayout();
Mage::unregister('cmstemplate_navigation/grid');
}
<?php
function createImage($str) {
header("Content-type: image/png");
$handle = ImageCreate(180, 50);
ImageColorAllocate($handle, 255, 0, 0);
$txt_color = ImageColorAllocate($handle, 255,255, 255);
ImageString($handle, 5, 15, 18, $str, $txt_color);
imageflip($handle, IMG_FLIP_HORIZONTAL);
ImagePng($handle);
}