本文整理匯總了PHP中Q::fact方法的典型用法代碼示例。如果您正苦於以下問題:PHP Q::fact方法的具體用法?PHP Q::fact怎麽用?PHP Q::fact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Q
的用法示例。
在下文中一共展示了Q::fact方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DbUtil
<?php
require './__init__.php';
Rhaco::import('generic.Flow');
Rhaco::import('database.DbUtil');
Rhaco::import('model.Category');
Rhaco::import('model.Todo');
$db = new DbUtil(Category::connection());
$flow = new Flow();
$flow->setVariable('categories', $db->select(new Category()));
$flow->setVariable('object_list', $db->select(new Todo(), new C(Q::fact())));
$flow->write('list.html');
示例2: DbUtil
<?php
require_once '__init__.php';
Rhaco::import('generic.Urls');
Rhaco::import('model.Todo');
Rhaco::import('model.Category');
$db = new DbUtil(Category::connection());
$patterns = array('^$' => array('class' => 'generic.Views', 'method' => 'read', 'args' => array(new Todo(), new C(Q::eq(Todo::columnClose(), false), Q::fact())), 'template' => 'list.html'), '^detail/(\\d+)$' => array('method' => 'detail', 'args' => array(new Todo(), new C(Q::fact()))), '^create$' => array('method' => 'create', 'args' => array(new Todo(), Rhaco::url())), '^update/(\\d+)$' => array('method' => 'update', 'args' => array(new Todo(), null, Rhaco::url())), '^delete/(\\d+)$' => array('method' => 'delete', 'args' => array(new Todo(), null, Rhaco::url())), '^cat/(\\d+)$' => array('method' => 'detail', 'args' => array(new Category(), new C(Q::depend()))));
$parser = Urls::parser($patterns, $db);
$parser->setVariable('categories', $db->select(new Category()));
$parser->write();
示例3: Views
<?php
require './__init__.php';
Rhaco::import('generic.Views');
Rhaco::import('model.Category');
Rhaco::import('model.Todo');
$views = new Views();
$views->read(new Todo(), new C(Q::fact()));
$views->setVariable('categories', $views->dbUtil->select(new Category()));
$views->write('list.html');