Welcome Guest, Not a member yet? Register   Sign In
Help with helpers
#1

[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

CONTROLLER

primitive controller.php code

How to send a number to a helper..

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...


Thankyou

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

(forgot the first few characters of error Smile )
#2

[eluser]sarah fox[/eluser]
Hi,

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...
#3

[eluser]pickupman[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB