Question

i'm having problem with codeigniter + grocery crud installation.

Below is my file structure:

base/ci_213/application/demo/config/config.php
                $config['base_url'] = 'http://localhost/';
                $config['index_page'] = '';

base/ci_213/application/demo/config/autoload.php
                $autoload['libraries'] = array('database', 'grocery_CRUD');         
                $autoload['helper'] = array('url');
base/ci_213/system/...
base/ci_213/assets/...
base/www/index.php
        $system_path        = '../ci_213/system';
        $application_folder = '../ci_213/application/demo';

With the above setting, i'm able to view webpage "Welcome to CodeIgniter!" (localhost)

member.php

class Member extends CI_Controller
{
    public function __construct()   {       parent::__construct();    }
    public function index() { echo "<h1>Welcome to the world of Codeigniter</h1>";  }

    public function employees()
    {
    $crud = new grocery_CRUD();
    $crud -> set_table('employees');
    $output = $crud -> render();
    $this -> load -> view('template_member', $output);
    }
}

template_member.php

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Grocery CRUD Testing</title>
        <?php   foreach($css_files as $file): ?>
        <link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
        <?php   endforeach; ?>
        <?php   foreach($js_files as $file): ?>
        <script src="<?php echo $file; ?>"></script>
        <?php   endforeach; ?>
        <style type='text/css'>
    </head>
    <body> 
    <?php   echo $output;   ?>

I'm able to view "Welcome to the world of Codeigniter" (localhost/member)

I'm having problem to view (localhost/member/employees). It shows me a blank white page.

But when i look at the html code, it shows all the employees data are inside the html code.
I do not know why it does not display the content but give a blank white page.

Pls advice what i've missed out, thanks.

Partial html code:

<link type="text/css" rel="stylesheet" href="http://localhost/assets/grocery_crud/themes/flexigrid/css/flexigrid.css" />
<link type="text/css" rel="stylesheet" href="http://localhost/assets/grocery_crud/css/jquery_plugins/fancybox/jquery.fancybox.css" />
<script src="http://localhost/assets/grocery_crud/js/jquery-1.8.2.min.js"></script>
<script src="http://localhost/assets/grocery_crud/themes/flexigrid/js/cookies.js"></script>
<script src="http://localhost/assets/grocery_crud/themes/flexigrid/js/flexigrid.js"></script>
<script src="http://localhost/assets/grocery_crud/themes/flexigrid/js/jquery.form.js"></script>
<script src="http://localhost/assets/grocery_crud/js/jquery_plugins/jquery.numeric.min.js"></script>
<script src="http://localhost/assets/grocery_crud/themes/flexigrid/js/jquery.printElement.min.js"></script>
<script src="http://localhost/assets/grocery_crud/js/jquery_plugins/jquery.fancybox.pack.js"></script>
<script src="http://localhost/assets/grocery_crud/js/jquery_plugins/jquery.easing-1.3.pack.js"></script>
Was it helpful?

Solution

In template_member.php delete row with code <style type='text/css'> or replace it with a code <style type='text/css'></style>.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top