CodeIgniter Forums
Slice Library to simulate Blade's template system! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7)
+--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13)
+--- Thread: Slice Library to simulate Blade's template system! (/showthread.php?tid=68049)



Slice Library to simulate Blade's template system! - Gustavo Martins - 05-16-2017

Hi guys!  Big Grin

I've been working on a library to simulate Laravel's Blade template system. And I'm happy to share with you this library!

Get it on GitHub: Slice-Library

The main features are:

  • There are more than 30 directives similar to Blade
  • Easy to install and use
  • Manages templates, views, languages
  • compatible with modular extension - HMVC
  • Very well documented!
Some of the directives are:
  • @section()
  • @yield()
  • @if()
  • @foreach()
  • @forelse()
  • And many more!
Please, try it!!  Cool

I hope this can be useful for all of us!

Get it on GitHub: Slice-Library


RE: Slice Library to simulate Blade's template system! - PaulD - 05-17-2017

Wow. Very nice indeed.

I have noted this and will try it out at the very next opportunity.

Looks really nicely coded and is certainly feature rich. Good job and thank you for sharing.

Best wishes,

Paul.


RE: Slice Library to simulate Blade's template system! - harshalone - 11-09-2019

(05-16-2017, 09:15 PM)Gustavo Martins Wrote: Hi guys!  Big Grin

I've been working on a library to simulate Laravel's Blade template system. And I'm happy to share with you this library!

Get it on GitHub: Slice-Library

The main features are:

  • There are more than 30 directives similar to Blade
  • Easy to install and use
  • Manages templates, views, languages
  • compatible with modular extension - HMVC
  • Very well documented!
Some of the directives are:
  • @section()
  • @yield()
  • @if()
  • @foreach()
  • @forelse()
  • And many more!
Please, try it!!  Cool

I hope this can be useful for all of us!

Get it on GitHub: Slice-Library


hi @Gustavo

I am using your slice library but I am getting this error with HMVC Modules

An uncaught Exception was encountered
Type: Error

Message: Call to a member function view() on null

Here is my welcome controller

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Welcome extends MX_Controller {
    
    public function 
__contruct(){
        
        
parent:: __contruct();
        
$this->load->library('slice');
        
    }
 
    public function 
index()
    {
        
$data  = new stdClass();
          
        
$this->slice->view('welcome/welcome'$data);
    }