share function in views

2009-01-12 Thread Henrik Gemal

I have a custom html escape function that I like to be able to use in
two views.
What's the best way to share function between views?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: share function in views

2009-01-12 Thread grigri

Put it in a helper, then use the helper in each view.

On Jan 12, 10:51 am, Henrik Gemal henrikge...@gmail.com wrote:
 I have a custom html escape function that I like to be able to use in
 two views.
 What's the best way to share function between views?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: share function in views

2009-01-12 Thread Adam Royle

If it's just a simple function, then you can place it in bootstrap.php
and it will be globally available.

Cheers,
Adam

On Jan 12, 8:51 pm, Henrik Gemal henrikge...@gmail.com wrote:
 I have a custom html escape function that I like to be able to use in
 two views.
 What's the best way to share function between views?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: share function in views

2009-01-12 Thread Kappa

I agree with the helper solution, it's more scalable.. now you have 1
function soon you'll maybe have 1 hundred..

On Jan 12, 1:00 pm, Adam Royle a...@sleekgeek.com.au wrote:
 If it's just a simple function, then you can place it in bootstrap.php
 and it will be globally available.

 Cheers,
 Adam

 On Jan 12, 8:51 pm, Henrik Gemal henrikge...@gmail.com wrote:

  I have a custom html escape function that I like to be able to use in
  two views.
  What's the best way to share function between views?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---