phpGrid_Lite doesnt show grid on CodeIgniter-3.1.7
I have followed the tutorial from the official webpage https://phpgrid.com/example/phpgrid-and-codeigniter-integration/
but my view doesn't show the grid, my database is called phpGrid and have a table producto, this problem only occur with CI, because i have tested phpGrid_Lite without CI and works fine showing the grid.
(sorry for my bad english :))
this is my Welcome
controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
//$this->load->view('welcome_message');
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php'); // APPPATH is path to application folder
$data['phpgrid'] = new C_DataGrid("SELECT * FROM producto", "id", "producto"); //$this->ci_phpgrid->example_method(3);
$this->load->view('show_grid',$data);
}
}
and here is my show_grid.php
file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?php $phpgrid->display(); ?>
</div>
</div>
</body>
</html>
the conf.php
<?php
/**/
if (stripos($_SERVER['SCRIPT_NAME'], 'apps/phpgrid-custom-crm')) {
define('PHPGRID_DB_HOSTNAME', '127.0.0.1'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
} else {
//* mysql example
define('PHPGRID_DB_HOSTNAME','localhost'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
}
and finally this is the result
php codeigniter continuous-integration phpgrid
add a comment |
I have followed the tutorial from the official webpage https://phpgrid.com/example/phpgrid-and-codeigniter-integration/
but my view doesn't show the grid, my database is called phpGrid and have a table producto, this problem only occur with CI, because i have tested phpGrid_Lite without CI and works fine showing the grid.
(sorry for my bad english :))
this is my Welcome
controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
//$this->load->view('welcome_message');
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php'); // APPPATH is path to application folder
$data['phpgrid'] = new C_DataGrid("SELECT * FROM producto", "id", "producto"); //$this->ci_phpgrid->example_method(3);
$this->load->view('show_grid',$data);
}
}
and here is my show_grid.php
file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?php $phpgrid->display(); ?>
</div>
</div>
</body>
</html>
the conf.php
<?php
/**/
if (stripos($_SERVER['SCRIPT_NAME'], 'apps/phpgrid-custom-crm')) {
define('PHPGRID_DB_HOSTNAME', '127.0.0.1'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
} else {
//* mysql example
define('PHPGRID_DB_HOSTNAME','localhost'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
}
and finally this is the result
php codeigniter continuous-integration phpgrid
add a comment |
I have followed the tutorial from the official webpage https://phpgrid.com/example/phpgrid-and-codeigniter-integration/
but my view doesn't show the grid, my database is called phpGrid and have a table producto, this problem only occur with CI, because i have tested phpGrid_Lite without CI and works fine showing the grid.
(sorry for my bad english :))
this is my Welcome
controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
//$this->load->view('welcome_message');
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php'); // APPPATH is path to application folder
$data['phpgrid'] = new C_DataGrid("SELECT * FROM producto", "id", "producto"); //$this->ci_phpgrid->example_method(3);
$this->load->view('show_grid',$data);
}
}
and here is my show_grid.php
file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?php $phpgrid->display(); ?>
</div>
</div>
</body>
</html>
the conf.php
<?php
/**/
if (stripos($_SERVER['SCRIPT_NAME'], 'apps/phpgrid-custom-crm')) {
define('PHPGRID_DB_HOSTNAME', '127.0.0.1'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
} else {
//* mysql example
define('PHPGRID_DB_HOSTNAME','localhost'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
}
and finally this is the result
php codeigniter continuous-integration phpgrid
I have followed the tutorial from the official webpage https://phpgrid.com/example/phpgrid-and-codeigniter-integration/
but my view doesn't show the grid, my database is called phpGrid and have a table producto, this problem only occur with CI, because i have tested phpGrid_Lite without CI and works fine showing the grid.
(sorry for my bad english :))
this is my Welcome
controller
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
//$this->load->view('welcome_message');
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php'); // APPPATH is path to application folder
$data['phpgrid'] = new C_DataGrid("SELECT * FROM producto", "id", "producto"); //$this->ci_phpgrid->example_method(3);
$this->load->view('show_grid',$data);
}
}
and here is my show_grid.php
file
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?php $phpgrid->display(); ?>
</div>
</div>
</body>
</html>
the conf.php
<?php
/**/
if (stripos($_SERVER['SCRIPT_NAME'], 'apps/phpgrid-custom-crm')) {
define('PHPGRID_DB_HOSTNAME', '127.0.0.1'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
} else {
//* mysql example
define('PHPGRID_DB_HOSTNAME','localhost'); // database host name
define('PHPGRID_DB_USERNAME', 'root'); // database user name
define('PHPGRID_DB_PASSWORD', ''); // database password
define('PHPGRID_DB_NAME', 'phpGrid'); // database name
define('PHPGRID_DB_TYPE', 'mysql'); // database type
define('PHPGRID_DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
}
and finally this is the result
php codeigniter continuous-integration phpgrid
php codeigniter continuous-integration phpgrid
edited Jun 21 at 22:45
Michael Lihs
2,36142345
2,36142345
asked Jun 21 at 22:34
luis
11
11
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Did you configure CI to use native PHP session? You may also need to add .htaccess in the application folder due to permission update in CI3.
add a comment |
I ran into the same problem with CI and phpgrid Lite and this is how I got the grids to appear.
I moved the assets folder from the application/library so it is in the same folder as the application folder and the system folder.
Then I altered these parts of the controller and view.
Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
require_once('assets/phpGrid_Lite/conf.php');
$dg = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
$dg -> set_multiselect(true);
$dg -> enable_search(true);
$dg->display(false);
$data['phpgrid'] = $dg->get_display(true);
$this->load->view('show_grid',$data);
}
}
In the View file show_grid.php
View:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?= $phpgrid; ?>
</div>
</div>
</body>
</html>
Hope this works for you.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50978307%2fphpgrid-lite-doesnt-show-grid-on-codeigniter-3-1-7%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Did you configure CI to use native PHP session? You may also need to add .htaccess in the application folder due to permission update in CI3.
add a comment |
Did you configure CI to use native PHP session? You may also need to add .htaccess in the application folder due to permission update in CI3.
add a comment |
Did you configure CI to use native PHP session? You may also need to add .htaccess in the application folder due to permission update in CI3.
Did you configure CI to use native PHP session? You may also need to add .htaccess in the application folder due to permission update in CI3.
answered Nov 7 at 18:16
BinBin
763
763
add a comment |
add a comment |
I ran into the same problem with CI and phpgrid Lite and this is how I got the grids to appear.
I moved the assets folder from the application/library so it is in the same folder as the application folder and the system folder.
Then I altered these parts of the controller and view.
Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
require_once('assets/phpGrid_Lite/conf.php');
$dg = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
$dg -> set_multiselect(true);
$dg -> enable_search(true);
$dg->display(false);
$data['phpgrid'] = $dg->get_display(true);
$this->load->view('show_grid',$data);
}
}
In the View file show_grid.php
View:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?= $phpgrid; ?>
</div>
</div>
</body>
</html>
Hope this works for you.
add a comment |
I ran into the same problem with CI and phpgrid Lite and this is how I got the grids to appear.
I moved the assets folder from the application/library so it is in the same folder as the application folder and the system folder.
Then I altered these parts of the controller and view.
Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
require_once('assets/phpGrid_Lite/conf.php');
$dg = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
$dg -> set_multiselect(true);
$dg -> enable_search(true);
$dg->display(false);
$data['phpgrid'] = $dg->get_display(true);
$this->load->view('show_grid',$data);
}
}
In the View file show_grid.php
View:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?= $phpgrid; ?>
</div>
</div>
</body>
</html>
Hope this works for you.
add a comment |
I ran into the same problem with CI and phpgrid Lite and this is how I got the grids to appear.
I moved the assets folder from the application/library so it is in the same folder as the application folder and the system folder.
Then I altered these parts of the controller and view.
Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
require_once('assets/phpGrid_Lite/conf.php');
$dg = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
$dg -> set_multiselect(true);
$dg -> enable_search(true);
$dg->display(false);
$data['phpgrid'] = $dg->get_display(true);
$this->load->view('show_grid',$data);
}
}
In the View file show_grid.php
View:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?= $phpgrid; ?>
</div>
</div>
</body>
</html>
Hope this works for you.
I ran into the same problem with CI and phpgrid Lite and this is how I got the grids to appear.
I moved the assets folder from the application/library so it is in the same folder as the application folder and the system folder.
Then I altered these parts of the controller and view.
Controller:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
require_once('assets/phpGrid_Lite/conf.php');
$dg = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
$dg -> set_multiselect(true);
$dg -> enable_search(true);
$dg->display(false);
$data['phpgrid'] = $dg->get_display(true);
$this->load->view('show_grid',$data);
}
}
In the View file show_grid.php
View:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Show Grid</title>
</head>
<body>
<div id="container">
<h1>Welcome to CodeIgniter! Show me the grid!</h1>
<div id="body">
<?= $phpgrid; ?>
</div>
</div>
</body>
</html>
Hope this works for you.
edited Nov 26 at 23:03
answered Nov 12 at 0:26
Siel
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50978307%2fphpgrid-lite-doesnt-show-grid-on-codeigniter-3-1-7%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown