What this does, is basically counts how many unread messages there are, and returns a different html template. Now, I don't have messages model in my app, so let's say I want to return a count of how many users my app has. Lets call it UsersCountCell for now.
In my app folder, I create UsersCountCell.php with the following content,
This will properly render the html from your users_count.blade.php, whereas previously mentioned renderable would require you to render it like this {!! $cell !!}. You can actually use both interfaces, and then in your toHtml() method just return $this->render();
Let me know if you need any more information, I might write a blog post about this 🤔
thanks, Dainius.
BTW do you have any working example of the same?
Actually, you should probably use Htmlable interface, if you want to return html from your 'cell'.
Well lets take a look at this example from CakePHP
What this does, is basically counts how many unread messages there are, and returns a different html template. Now, I don't have messages model in my app, so let's say I want to return a count of how many users my app has. Lets call it UsersCountCell for now.
In my app folder, I create UsersCountCell.php with the following content,
You then use it like this:
This will properly render the html from your users_count.blade.php, whereas previously mentioned renderable would require you to render it like this {!! $cell !!}. You can actually use both interfaces, and then in your toHtml() method just return $this->render();
Let me know if you need any more information, I might write a blog post about this 🤔
thanks a lot.
I guess I can work on this. thanks a lot and I will be waiting for the article...
:P