This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Site extends CI_Controller { | |
//Shows data inserted and views | |
public function index() | |
{ | |
if($query=$this->site_model->get_records()){ | |
$data['records']=$query; | |
} | |
$this->load->view('option_view',$data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
| ------------------------------------------------------------------- | |
| AUTO-LOADER | |
| ------------------------------------------------------------------- | |
| This file specifies which systems should be loaded by default. | |
| | |
| In order to keep the framework as light-weight as possible only the | |
| absolute minimal resources are loaded by default. For example, | |
| the database is not connected to automatically since no assumption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Base Site URL | |
|-------------------------------------------------------------------------- | |
| | |
| URL to your CodeIgniter root. Typically this will be your base URL, | |
| WITH a trailing slash: | |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteCond $1 !^(index\.php|resources|robots\.txt) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L,QSA] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="<?php echo base_url();?>/css/style.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $this->table->generate($records); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->table->set_heading('Id','My Title','My Content'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
Query With Multiple Results | |
**************************************************************************/ | |
/*--------------------------------------------------------------*/ | |
Obejct Version | |
/*--------------------------------------------------------------*/ | |
$query = $this->db->query('SELECT name, title, email FROM my_table'); | |
foreach ($query->result() as $row) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ************************************************************************** --> | |
<!-- Load multiple Views --> | |
<!-- ************************************************************************** --> | |
<?php | |
class Page extends CI_Controller { | |
function index() | |
{ | |
$data['page_title'] = 'Your title'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************* | |
Loading a Config File | |
**************************************************************************/ | |
/*---------------------------------- | |
Manual Loading | |
----------------------------------*/ | |
$this->config->load('filename'); | |
/************************************************************************* | |
Fetching Config Items | |
**************************************************************************/ |