Clarification how to use view_cell, layouts or views |
Hi, I'm not sure of the "correct" way either - I do it like this:
In the controller: echo view('front', $this->data); In view file 'front.php': <!DOCTYPE html> <html> <head><!-- head stuff --></head> <body> <?= $this->include('home') ?> <!-- this points to view file home.php in the app/Views directory <footer><!-- footer stuff --></footer> </body> </html> view file home.php contains: <main> <header><h1>Very neat, and semantically correct HTML stuff</h1></header> <section>....</section> <!-- I also may have a little, hidden form embeded in this file, that is located in app/Views/modules/popform.php, like so: --> <?= $this->include('modules/popform') ?> </main> If someone more senior sees this and cringes please tell me before I write a lot of stuff this way. Or is it good?
You can see things I made with codeigniter here: itart.pro its not overly impressive as I have very little time to learn.
|
Messages In This Thread |
Clarification how to use view_cell, layouts or views - by elserra - 04-12-2020, 10:42 PM
RE: Clarification how to use view_cell, layouts or views - by Leo - 04-15-2020, 04:23 AM
RE: Clarification how to use view_cell, layouts or views - by elserra - 04-15-2020, 12:58 PM
RE: Clarification how to use view_cell, layouts or views - by stlake2011 - 04-15-2020, 05:32 AM
RE: Clarification how to use view_cell, layouts or views - by kilishan - 04-15-2020, 01:32 PM
RE: Clarification how to use view_cell, layouts or views - by Corsari - 04-16-2023, 01:38 AM
RE: Clarification how to use view_cell, layouts or views - by elserra - 04-15-2020, 01:50 PM
RE: Clarification how to use view_cell, layouts or views - by InsiteFX - 04-16-2023, 11:11 PM
RE: Clarification how to use view_cell, layouts or views - by Corsari - 04-16-2023, 11:27 PM
RE: Clarification how to use view_cell, layouts or views - by kenjis - 04-17-2023, 12:27 AM
|