• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Template View Library

#1
Hello everyone

Below is a library that makes it easy to work with templates in Codeigniter 4

How would you upload it using this library:

PHP Code:
  public function index()
        {
                $data = [
                        'page_title' => 'Your title'
                ];

                // Here
                $this->template->load('template_name''page_name'$data)
        

Link is here: <https://github.com/matheuscastroweb/ci4-template-view>
Reply

#2
I think you may have missed the new View Layouts in CI4.
Reply

#3
(03-06-2020, 02:06 PM)kilishan Wrote: I think you may have missed the new View Layouts in CI4.

Hello, kilishan

I didn't like the views layouts so much.

The need to add in each view affects the maintenance issue.

I used this library in Codeigniter v3, I rewrote it for use in v4 because I found it practical and useful.

As I understand it, the use of:

PHP Code:
<?= $this->extend('default'?>

It can be used only inside the View, in my opinion, this is more practical in the Controllers, leaving the View files just to "display", very transparent.

Well, of course this is a personal opinion. Anyway, I decided to share the Library with those interested.
Reply

#4
No worries. Just wanted to make sure you had seen it and it sounds like you have. So thanks for sharing your library with us!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.