Smarty

Release: Pale Purple's Trac Project Planning Board

This week, we are releasing our first full open source project.

It's basically a piece of web-based software, written in Python and PHP, that allows you to allocate tickets from multiple Trac projects to a simple week-based 'board' in order to organise work priority for developers.

More training courses

We've scheduled some more PHP training courses up to June next year, running monthly.

People who are active members of Birmingham, Wolverhampton or Redditch and Bromsgrove LUGs or PHPWM can receive a discount of £25/day

See here for more details

PHP 5.2.1

PHP 5.2.1, PCRE and Suhosin

With the impending 'Month of Bugs' for PHP, and the new release of version 5.2.1 the other day it seemed as if it would be a good time to upgrade.

Oxford Compsoc Talk on PHP

I've put the slides we presented to Oxford computer society online - see here - it's based on a shorter version we gave to the UK Linux Expo thing a few months ago.

Smarty : A PHP templating framework - Quickstart / Howto / Tutorial

What is Smarty?

Smarty is a PHP framework (or Template Engine, depending on your point of view). It is licensed under the LGPL and works under either PHP4 or PHP5.

Smarty - Nested Function calls when using Objects

Smarty - Nested/Chained function calls when using Objects

When using Smarty, I've been trying to embed something like the following to chain method calls together :

{$theObject->getUser()->getName()}

That, at least with Smarty 2.4.14, doesn't work.

Thankfully, #smarty on freenode, provided the following fix which I'll include here, just incase the link breaks :

Index: Smarty_Compiler.class.php
===================================================================
RCS file: /repository/smarty/libs/Smarty_Compiler.class.php,v
retrieving revision 1.382
diff -u -r1.382 Smarty_Compiler.class.php
--- Smarty_Compiler.class.php	28 May 2006 17:35:05 -0000	1.382
+++ Smarty_Compiler.class.php	11 Jul 2006 14:57:13 -0000
@@ -161,7 +161,7 @@
         $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp
                 . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)';
         $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';
-        $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
+        $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . '' . '(?:' . $this->_obj_ext_regexp . $this->_obj_params_regexp . ')*' . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)';
         
         // matches valid modifier syntax:
         // |foo

So that now works properly, and I don't have to do something nasty like :

Syndicate content