I want to display the content from my database in pages as home, about, terms,privacy,etc.
If somebody knows how to create new pages, please reply me
This is my database
![[Image: 3c5b4316bcb17a3c7166fb71edc72100o.jpg]]()
here is my controller:
here is my model:
here is my view:
If somebody knows how to create new pages, please reply me
This is my database
![[Image: 3c5b4316bcb17a3c7166fb71edc72100o.jpg]](http://fotos.subefotos.com/3c5b4316bcb17a3c7166fb71edc72100o.jpg)
here is my controller:
PHP Code:
class Paginas extends CI_Controller {
public function about(){
$data['title'] = 'About';
$data['paginas'] = $this->paginas_model->get_paginas();
// check connection, not working.
// print_r($data['paginas']);
$this->load->view('templates/head', $data);
$this->load->view('templates/navbar', $data);
$this->load->view('paginas/about',$data);
$this->load->view('templates/footer', $data);
}
}
here is my model:
PHP Code:
class Paginas_model extends CI_Model{
// Connect to database //
public function __construct(){
$this->load->database();
}
// Get Paginas from database //
public function get_paginas($slug=FALSE){
if($slug===FALSE){
$query=$this->db->get('paginas');
return $query->result_array();
}
$query=$this->db->get_where('paginas', array('slug'=>$slug));
return $query->row_array();
}
}
here is my view:
PHP Code:
<div class="container" id="main">
<div class="row">
<div class="col-md-8 animated fadeIn">
<?php foreach($paginas as $page) : ?>
<p><?php echo $page['contenido']; ?></p>
<?php endforeach ?>
<h4>Our Mission</h4>
<p>To provide the most actionable app store data.</p>
<p>At Apptopia, we all come to work every day because we want to solve the biggest problem in mobile. <b>Everyone is guessing</b>. Publishers don’t know what apps to build, how to monetize them, or even what to price them at. Advertisers & brands don’t know where their target users are, how to reach them, or even how much they need to spend in order to do so. Investors aren’t sure which apps and genres are growing the quickest, and where users are really spending their time (and money).</p>
<p>Throughout the history of business, people use <b>data</b> to make more informed decisions. Our mission at Apptopia is to make the app economy more transparent. Today we provide the most actionable mobile app data & insights in the industry. We want to make this data available to as many people as possible (not just the top 5%).</p>
</div>
$this->load->view('templates/kk');
</div>
</div>