# Stencil **Repository Path**: starcuan/Stencil ## Basic Information - **Project Name**: Stencil - **Description**: Stencil 是一个 CodeIgniter 的模板引擎,通过简单可靠的方式来渲染 HTML 页面 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/stencil - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-05-12 - **Last Updated**: 2024-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README  Stencil :fire: :pencil2: =========================== Stencil is a Codeigniter template engine for generating HTML pages in a simple yet very robust and powerful way. It's awesome template system for Codeigniter. Stencil is the perfect out-of-the-box solution for all your Codeigniter projects. ### [View the Official Docs](http://scotch.io/docs/stencil) ### [Play with the Demo](http://stencil.scotch.io) nick@scotch.io or chris@scotch.io ## Features ##### Layouts ##### Codeigniter 2.1.3 Ready ##### Slices `Child Views` `Partials` `Nested Views` `Elements` `Includes` ##### HTML5 Helpers `add_css()` `add_js()` `add_meta()` `shiv()` `chrome_frame()` `view_port()` `apple_mobile()` `windows_tile()` `favicons()` `jquery()` `asset_url()` ##### Load Page Specific Assets `JS` `CSS` `Perfect for jQuery Plugins` ##### Slice Callbacks `Run or return a block of code everytime a view is called` ##### Asset Management ##### Smart Data Binding to Views `$this->stencil->data('key', 'value')` `$this->stencil->data(array('key' => 'value'))` ## Example Use  ### Controller ```php stencil->layout('home_layout'); $this->stencil->slice('header'); $this->stencil->slice('footer'); } public function index() { $this->stencil->title('Home Page'); $this->stencil->js('some-plugin'); $this->stencil->js('home-slider'); $this->stencil->css('home-slider'); $this->stencil->meta(array( 'author' => 'Nicholas Cerminara', 'description' => 'This is the home page of my website!', 'keywords' => 'stencil, example, fun stuff' )); $data['welcome_message'] = 'Welcome to my website using Stencil!'; $this->stencil->paint('home_view', $data); } } /* End of file home.php */ /* Location: ./application/controllers/home.php */ ``` ### Layout #### (/views/layouts/..) ```php