0

Is there a way to return 'no results' from a custom plugin with the standard conditional of:

{if no_results}{/if}

I have resulted to using:

if ($query->num_rows() > 0) {

} else {
    return $this->return_data = "<li><p>Sorry, no results</p></li>";
}

Thanks.

1 Answer 1

3

Yes, of course!

return $this->return_data = ee()->TMPL->no_results();

Or this, on the versions before 2.6:

return $this->return_data = $this->EE->TMPL->no_results();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.