项目作者: NorthWebSolutions

项目描述 :
Codeigniter Library to construct frontend with integrated support for bootstarp 4.0A, jQuery, Font Awsome 5, Animate CSS, etc
高级语言: PHP
项目地址: git://github.com/NorthWebSolutions/CI_PageConstructor.git
创建时间: 2018-01-09T16:41:05Z
项目社区:https://github.com/NorthWebSolutions/CI_PageConstructor

开源协议:MIT License

下载


CI_PageConstructor v0.3

Codeigniter Library to construct frontend with integrated support for

  • Bootstrap 4.0A
  • jQuery
  • Font Awesome 5
  • Animate CSS
  • optional directory based css loading
  • optional js run file
  • Favicon
  • Meta / Page title

Easy integration:

Composer: will be coming soon..

manual:

  1. Copy the PageConstructor.php to /application/libraries/
  2. load PC to CI whit auto or manual method.
  3. Optional edit the settings/switches in the PageConstructor as you need.
  4. Construct your HTML header with $this->PC->HEAD();
  5. Construct your Footer with $this->PC->FOOTER(); to the end of your content.
  • Now your frontend contains all nessesery files to use bootstrap 4 &

Manual Load to CodeIgniter

implement the CodeIgniterigniter standard library load method in the __construct or in the function.
Example:

  1. $this->load->library('PageConstructor' => 'PC');

AutoLoad to CodeIgniter

change in /application/config/autoload.php around line 61..
$autoload['libraries'] = array();
To
$autoload['libraries'] = array('PageConstructor' => 'PC');

now you can use PC as an object ready to generate the frontend boring part :)

Example

if the PageConstructor is loaded with AutoLoader

Controller

  1. class Home extends CI_Controller {
  2. public function __construct() {
  3. parent::__construct();
  4. $this->PC->HEAD();
  5. }
  6. public function index() {
  7. if($this->uri->segment(1) != NULL && $this->uri->segment(2) != NULL){
  8. $data["loadThisView"] = $this->uri->segment(1)."/".$this->uri->segment(2);
  9. $this->load->view('template.php', $data);
  10. }else{
  11. $this->load->view('main.php');
  12. }
  13. }
  14. }

The main.php or the Template.php:

  1. <?php
  2. if(isset($loadThisView)){
  3. $this->load->view($loadThisView);
  4. }else {
  5. echo '<pre>content not loaded, error</pre>';
  6. }
  7. $this->PC->FOOTER();
  8. ?>