Skip to content

Instantly share code, notes, and snippets.

@jlamim
Created August 8, 2016 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlamim/79874b6202463611f4878128b6973e39 to your computer and use it in GitHub Desktop.
Save jlamim/79874b6202463611f4878128b6973e39 to your computer and use it in GitHub Desktop.
Bower, DataTable e CodeIgniter - Welcome.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
/**
* Método para carregar a página principal do exemplo
*
* @return mixed
*/
public function index()
{
$this->load->view('welcome_message');
}
/**
* Método para gerar os dados para o DataTable
*
* @return json
*/
public function Datatable(){
$dados['data'] = array(
array("Tiger Nixon","System Architect","Edinburgh","5421","2011/04/25","$320,800"),
array("Garrett Winters","Accountant","Tokyo","8422","2011/07/25","$170,750"),
array("Ashton Cox","Junior Technical Author","San Francisco","1562","2009/01/12","$86,000"),
array("Cedric Kelly","Senior Javascript Developer","Edinburgh","6224","2012/03/29","$433,060"),
array("Airi Satou","Accountant","Tokyo","5407","2008/11/28","$162,700"),
array("Brielle Williamson","Integration Specialist","New York","4804","2012/12/02","$372,000"),
array("Herrod Chandler","Sales Assistant","San Francisco","9608","2012/08/06","$137,500"),
array("Rhona Davidson","Integration Specialist","Tokyo","6200","2010/10/14","$327,900")
);
//Usamos um sleep apenas para que as mensagens de processando e carregando
//do DataTable possam ser vistas
//Em uma aplicação real não deve ser utilizado
sleep(5);
echo json_encode($dados);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment