Posted: February 2nd, 2011

Zend_Navigation and Routes

Category: technical
Tags: ,

now here’s my take on the Zend_Navigation and routes. Normally you can set a resource class to do this, but I rather do it in the bootstrap. kinda the same thing in my opinion, i decided not to use a xml config but a ini config type, this way you don’t have to worry if your tags are closed properly. if it works for you awesome.


protected function _initNavigation() {
// set up navigation
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/navigation.ini','navi');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation);
return $view;
}


protected function _initRoutes() {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/navigation.ini', 'routes');
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$router->addConfig($config,'routes');
$front->setRouter($router);
return $router;
}

sample ini file

;put routes here.
[routes]
routes.dashboard.route = "/dashboard"
routes.dashboard.defaults.controller = index
routes.dashboard.defaults.action = dashboard


;navigation
[navi]
dashboard.route = "dashboard"
dashboard.controller = index
dashboard.action = dashboard
dashboard.label = dashboard
dashboard.class = dashboard

Posted: November 10th, 2010

Reserved Words in Javascript (good to keep documented)

Category: technical
Tags: , ,

JavaScript Reserved Words

JavaScript Reserved Words
break continue do for import new this void
case default else function in return typeof while
comment delete export if label switch var with

Java Keywords (Reserved by JavaScript)
abstract implements protected
boolean instanceOf public
byte int short
char interface static
double long synchronized
false native throws
final null transient
float package true
goto private  

ECMAScipt Reserved Words
catch enum throw
class extends try
const finally  
debugger super  

Other JavaScript Keywords
alert eval Link outerHeight scrollTo
Anchor FileUpload location outerWidth Select
Area find Location Packages self
arguments focus locationbar pageXoffset setInterval
Array Form Math pageYoffset setTimeout
assign Frame menubar parent status
blur frames MimeType parseFloat statusbar
Boolean Function moveBy parseInt stop
Button getClass moveTo Password String
callee Hidden name personalbar Submit
caller history NaN Plugin sun
captureEvents History navigate print taint
Checkbox home navigator prompt Text
clearInterval Image Navigator prototype Textarea
clearTimeout Infinity netscape Radio toolbar
close innerHeight Number ref top
closed innerWidth Object RegExp toString
confirm isFinite onBlur releaseEvents unescape
constructor isNan onError Reset untaint
Date java onFocus resizeBy unwatch
defaultStatus JavaArray onLoad resizeTo valueOf
document JavaClass onUnload routeEvent watch
Document JavaObject open scroll window
Element JavaPackage opener scrollbars Window
escape length Option scrollBy  
Posted: August 17th, 2010

Flowerpower.

Category: images, technical
Tags: , ,

this is a cool website. Done with the Canvas element in HTML5

here’s flowerpoop drawn out.

if you draw some stuff we’ll host it here.

http://www.openrise.com/lab/FlowerPower/

Posted: July 13th, 2010

Installing ImageMagick, and pecl imagick

Category: technical
Tags:

I needed ImageMagick to do some image manipulation, i ran across this very cool php extension. instead of using GD. you may run into some small snafus while trying to install it. my system is fedora core 12

first thing you do is install ImageMagick, and ImageMagick-devel

yum install ImageMagick-devel ImageMagick

then you run pecl

pecl install imagck

if you run into any problems like re2c not being up to date. pull the latest RPM, and install.

the cool thing about this extension is when you want to resize images on the fly its as easy as this

<?php

header(‘Content-type: image/jpeg’);

$image = new Imagick(‘image.jpg’);

// If 0 is provided as a width or height parameter,
// aspect ratio is maintained
$image->thumbnailImage(100, 0);

echo $image;

?>

Your Ad Here
Posted: June 12th, 2010

Zend Framework redirect within plugin

Category: technical
Tags: , , ,

if you ever need to redirect w/in a plugin

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper(‘redirector’);
$redirector->gotoUrl(‘url’);
Your Ad Here