RSS - Latest posts Code Category

Home » Category » Code
29Jul
2009

Redirect in controller plugin – Zend Framework 1.8

If you need to redirect while inside a controller plugin, for example in preDispatch() here is a quick way to do it:

$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
$redirector->gotoUrl('/login/');

Categories:

14Jun
2009

Hitch. Object-oriented event handlers with jQuery

Moving to jQuery from YUI has been a 99% positive experience. Probably the only thing I’ve really missed was the ability provided by YUI Event to control the object scope that an event handler was executed in.

(more…)

Categories:

9May
2009

Doctrine Many To Many With Extra Fields

Recently I have started using Doctrine with Zend Framework. Most of the time it is great, but sometimes I get stuck on this or that issue. Most of my problems so far have been connected with the Many to Many relationship. Here are a few tips I learned the hard way. (more…)

Categories:

26Apr
2009

Week of the Month in Mysql

SELECT WEEK(my_date_field,5) -
WEEK(DATE_SUB(my_date_field, INTERVAL DAYOFMONTH(my_date_field)-1 DAY),5)+1

(more…)

Categories:

22Apr
2009

Zend_Db_Select multiple table joins explained

It sounds like a simple task – retrieve the result from a join SQL query. Unusually you can even find documentation on the official Zend Framework site explaining how to put together a query that will return the results from a JOIN query. Unfortunately when it actually comes to putting theory into practice any Zend newcomer can run into several problems. (more…)

Categories: