feature(views): allows rendering empty results using an anonymous function

If you want the no_results message to not be wrapped by P tags, or you don’t
want to always incur the cost of rendering a view for backup content, you
can now provide a Closure whose output will be echoed by the view.

TODO:
 - [ ] Agree to limit this to Closures for now
Ok

On Sat, Nov 29, 2014, 8:23 PM Steve Clay <notifications@github.com> wrote:

> In views/default/page/components/gallery.php:
>
> > @@ -26,6 +26,10 @@
> >  $no_results = elgg_extract('no_results', $vars, '');
> >
> >  if (!$items && $no_results) {
> > +	if ($no_results instanceof Closure) {
> > +		echo $no_results();
>
> Can we let Closure work for now? I really don't want to accept "non-string
> callables".
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Elgg/Elgg/pull/7349/files#r21058060>.
>