flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.63k stars 409 forks source link

flight+medoo error! #217

Closed ztd closed 8 years ago

ztd commented 8 years ago

flight+medoo use register methods error!help

ztd commented 8 years ago

flight+medoo新用Flight::register方法,medoo出现找不到quote方法,不能正常使用,怎么回事?

ycrao commented 8 years ago

不知道,你咋用的,我反正用的好好的

ztd commented 8 years ago

require 'flight/Flight.php'; require 'medoo.php';

Flight::register('db', 'medoo', array('database_type'=>'sqlite', 'database_file'=>'data.db')); Flight::route('/', function(){ $db = Flight::db(); $result = $db->select('table', '*', array('id'=>1)); var_dump($result); });

Flight::start();

Fatal error: Call to a member function query() on a non-object in /Users/ztd/PhpstormProjects/flight/medoo.php on line 167

ycrao commented 8 years ago

@ztd 你这哪里能直接这样用,请参考flight-app-demo 推荐使用Flight::map

ztd commented 8 years ago

@ycrao 谢谢,我已找到解决方法,要在数组参数上再嵌套一个数组: Flight::register('db', 'medoo', array(array('database_type'=>'sqlite', 'database_file'=>'data.db')));

FarhanShares commented 6 years ago

I'm having the same issue still now, is there any solution?