Help with helpers

[eluser]sarah fox[/eluser]
Hi, Has anyone got a PRIMITIVE / Basic guide to 'helpers' ?

I'm getting anerror message in my controllers

>> sing $this when not in object context in .....

has anyone got a basic example


primitive controller.php code

How to send a number to a helper..


Retrieve the number sent from controller
- add 1 to the number,
send it back to controller

Controller.php assigns the value to a variable - send to a view...

I've been to a few tutorial sites & they do not have 'primitive' (but complete) codes - They just show 1-liner codes, without any relation to a whole script...


EDIT :- Fatal error: Using $this when not in object context in

(forgot the first few characters of error Smile )

[eluser]sarah fox[/eluser]

Finally off to bed - but I figured it out...

Tomorow - I'll post my "simple" tutorial / Guide on how helpers are done ..

Is it possible to get the help-files updated ? & if so, who do I contact with my simple' code - For their consideration...

Helpers are simply php functions. You pass parameters just like you would to any php function if required. I think why they are referred to as helpers rather than functions is because of similar vocabulary between class functions (methods) and actual function names. Also, helpers may perform multiple php functions like sanitizing form input.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.