public function indexAction()
 {
     //用Init::getInstance()->config['Domain']['baidu']['host'];
     $curl = new HttpHandle('http://m.fang.com/zhishi/');
     //TODO修改Socket类的bug
     print_r($curl->output);
     // echo '<hr/>indexAction<br/>';
     /*if (isset($_GET['key1']) && isset($_GET['key1'])) {
     			echo $_GET['key1'].'<br/>';
     			echo $_GET['key2'];
     		}
     		
     		var_dump($this->config['DataBase']);
     		var_dump($this->config['Model']);*/
     echo '<hr/>';
     $db = Factory::getDatabase();
     $res = $db->query("select * from user limit 2");
     while ($row = mysqli_fetch_assoc($res)) {
         echo "id: {$row['id']} <br>";
         echo "name: {$row['name']} <br>";
         echo "phone: {$row['mobile']} <br>";
         echo "reg: {$row['regtime']} <br>";
     }
     //TODO实现数组
     //$res = array('0'=>'a','1'=>'b');
     $this->assign('res', 'first assign');
     $this->display('admin/index.php');
 }
Beispiel #2
0
 public function __construct($table)
 {
     $this->_db = \core\Factory::getDatabase();
     $this->_table = $table;
 }