function myFunction() {
echo 'This is a function';
}
I said that badly. for variables use F3-> set ( 'var', 'fair') and are global, and for functions?
$f3->set('var', function(){ return "value"; });
$val = $f3->var();
$f3->set('myfunc', function($a,$b) {
return $a+$b;
});
{{ @myfunc(2,3) }}
--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Fat-Free Framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/f3-framework/Lkjb66G7PpM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to f3-framework+unsubscribe@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/cff1ad28-f211-4d24-9894-bfd7349485fe%40googlegroups.com.
{{ \helper\toolbox::instance()->dosomething(@foo) }}
namespace helper;
class toolbox extends \prefab
{
...
/**
* Send bar to client
*/
public function dosomething($foo) {
return $bar
}