Re: [fw-general] Help with helpers

2008-02-13 Thread Simon Mundy
Sure! Just pass an instance of the helper back from its default  
method. E.g:-


class MyHelper_Calculator
{
public function calculator()
{
return $this;
}

public function add($a, $b)
{
return $a + $b;
}

...etc...
}

...and in your script you'd simply call it like so:-

Calculator()->add(3, 4) ?>

But I want to group several functions into one single helper. For  
example,

to have a "Calculation" helper with methods like "add", "substract",
"multiple", etc...

Is this possible???


--

Simon Mundy | Director | PEPTOLAB

""" " "" "" "" "" """ " "" " " " "  "" "" "

202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654  
4124

http://www.peptolab.com



Re: [fw-general] Help with helpers

2008-02-13 Thread Mauricio Cuenca

Hello, I just followed the tutorial found on:

http://www.ingredients.com.au/nick/2006/06/26/custom-view-helpers-in-zend-framework/

But I want to group several functions into one single helper. For example,
to have a "Calculation" helper with methods like "add", "substract",
"multiple", etc...

Is this possible???



Mauricio Cuenca wrote:
> 
> Hello, I am an old PHP (structured programming) programmer starting with
> Zend Framework. I am building a new app with ZF but now I need to use
> helpers. I kind of know what exactly they do, but I need some indications
> about the position they should have into the application's file structure,
> what is the exact syntax for declaration and how can I invoke a helper
> from a controller action.
> 
> I was searching in the framework documentation and googling for a while
> but could not find any really usefull.
> 
> Thanks!
> 

-- 
View this message in context: 
http://www.nabble.com/Help-with-helpers-tp15456824s16154p15456864.html
Sent from the Zend Framework mailing list archive at Nabble.com.