helios-ag/fm-lessql-bundle
最新稳定版本:0.1
Composer 安装命令:
composer require helios-ag/fm-lessql-bundle
包简介
Lessql bundle, adds LessQL ORM PHP to your Symfony project
README 文档
README
LessQL integration in Symfony2
LessQL is a lightweight and powerful alternative to Object-Relational Mapping for PHP.
Installation
Step 1: Installation
Using Composer, just add the following configuration to your composer.json:
Or you can use composer to install this bundle: Add FMBbcodeBundle in your composer.json:
composer require helios-ag/fm-lessql-bundle
Now tell composer to download the bundle by running the command:
composer update helios-ag/fm-lessql-bundle
Step 2: Enable the bundle
Finally, enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new FM\LessqlBundle\FMLessqlBundle(), ); }
Configuration
You can configure bundle as follows
fm_lessql: instances: default: dsn: sqlite:%kernel.root_dir%/test.sqlite3 username: '' password: '' options: mysql: dsn: mysql:host=localhost;dbname=testdb;charset=utf8 username: root password: 12345 options: 'PDO::ATTR_EMULATE_PREPARES': { value: false } 'PDO::ATTR_ERRMODE': { value: 'PDO::ERRMODE_EXCEPTION' }
##Usage Controller
class AppController extends Controller { /** * @Template() */ public function indexAction() { $db = $this->get('fm_lessql.manager')->getDB('default'); $posts = array(); $result = $db->table_name(); $result = $db->table( 'post' ); $row = $result->fetch(); // fetch next row in result $rows = $result->fetchAll(); // fetch all rows } }
More information can be found at http://lessql.net/
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-23