本文整理汇总了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');