当与propel

时间:2015-08-27 08:32:01

标签: get http-post propel slim

当我通过Slim运行Propel时,Propel生成的类没有被加载,我无法从数据库发布或获取数据。

我已将Propel与Slim集成在一起。我的所有数据库代码都在Propel文件中。 在Foo.php中

<?php 
namespace App;
//propels required files
class Foo extends someclass{
  public function foodata()
  {
    echo "hellow propel-Slim";
    $info = new Info();       // this class is in generated_classes
    $info->setInfodetails('medical info'); 
  }
}
?>

在index.php中

<?php
  //Slim's required files
  $app->post("/details/information", "\App\Foo:foodata"); 
?>

因此,每当我运行/details/information url时,它应调用函数foodata并使用类Info在表信息中插入数据。 相反,它只会打印echo语句并给我错误。

hellow propel-Slim
Fatal error: Class 'App\Info' not found in foo.php.

0 个答案:

没有答案