psamatt/spot-service-provider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

psamatt/spot-service-provider

Composer 安装命令:

composer require psamatt/spot-service-provider

包简介

A Spot (DataMapper ORM) service provider for Silex

关键字:

README 文档

README

A Spot ServiceProvider for Silex

Spot is a lightweight DataMapper written for PHP5.3+, its really easy to use and perfect for a small application built in Silex

Usage

Passing a dsn string

In order to connect to your MySQL database, pass a valid DSN string into the provider

$app->register(
    new Psamatt\Silex\SpotServiceProvider('mysql://username:password@localhost/db_name')
);

In your index.php, you can then interact with Spot with the following lines:

// Find all the posts from the database where the status is 1
$app['spot']->all('Entity\Post', array('status' => 1));
    
// Find one post where the title is Test Post
$app['spot']->first('Entity\Post', array('title' => "Test Post"));

For more information on how to use Spot, see the github repository page

Acknowledgement

Vance Lucas

统计信息

  • 总下载量: 44
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-07-15