HTML Table Class proper use |
Hello
with a little of surprise I observed that the whole page of the guide here https://codeigniter4.github.io/userguide...table.html doesn't mention at all the words "model", "view" and nor "controller" :-( there, a real full example may be really welcome (controller + view snippets) So as principle I suppose that the code snippets in that pages should be used in a controller but I'm a bit confused about the view part, so I thank in advance for any kind clarification In particular, I kindly ask how to properly use the HTML Table Class to display the results of my query in an HTML table, but displacing it in a PORTION of a view where in others portions of the same view, others queries will I output others kind of data (best practice for this, e.g like in a dashboard) as plus (but this becomes off topic) My final goal will be to provide also some sorting for the table' columns and when a new sorting happen, to have only the portion of the HTML table to be refreshed (HTMX?) . If you have any hint about this too, it would be great with many thanks in advance
Alright, as I got you, it is fine since CI always follows MVC rules and the HTML table is always a part of the VIEW from the controller. Here only thing I see is your own abstraction issue which I do mean CI4+ may not be accomplished for every one abstraction unless to offer some useful guidance on how to .. as we see if you have read here
https://codeigniter4.github.io/userguide...index.html and had tested it, I am sure it would help you go to the next step. You can see that you can implement it yourself in the controller and then pull it into your view. You can also you Madel if you have read about model in its guidance Personally, I use a CI HTML table with a view cell https://codeigniter4.github.io/userguide...=view_cell it is real work and amazing. I don't know if you would be interested in... o your question why don't you do this and pull in your normal view or view cell PHP Code: $table = new \CodeIgniter\View\Table(); and last, IN HTMX you may try this may help you https://github.com/michalsn/codeigniter-htmx Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
Hi Luckmoshy
Thank you really much, today I'll try to dive in all the aspects you pointed out And , also, I must tell you had read my mind, in fact I was wondering about if the HTML table class would have had sense in combination with CI cells Can you show a minimal example of how you implement it with a cell? Do you implement it with this feature https://codeigniter.com/user_guide/outgo...etup-logic ? P.S. the second piece of code in the link is confusing me, because view_cell calls a method 'show' that is not clear to me where it comes from PHP Code: // app/Cells/RecentPosts.php Thank you |
Welcome Guest, Not a member yet? Register Sign In |