本文整理汇总了PHP中Model_Order::products方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Order::products方法的具体用法?PHP Model_Order::products怎么用?PHP Model_Order::products使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Order
的用法示例。
在下文中一共展示了Model_Order::products方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form_setup
/**
*
* formmanager definitions
*
*/
public function form_setup($form)
{
$form->fields['id_product']['display_as'] = 'select';
$form->fields['id_product']['options'] = array_keys(Model_Order::products());
$form->fields['valid_date']['attributes']['placeholder'] = 'yyyy-mm-dd';
$form->fields['valid_date']['attributes']['data-toggle'] = 'datepicker';
$form->fields['valid_date']['attributes']['data-date'] = '';
$form->fields['valid_date']['attributes']['data-date-format'] = 'yyyy-mm-dd';
}
示例2: get_products
/**
* returns products to use in views in selects
* @return array
*/
public function get_products()
{
//for OC
if (method_exists('Model_Order', 'products')) {
//product without ad sell
$products = Model_Order::products();
unset($products[4]);
} elseif (class_exists('Model_Product')) {
$products = array();
$ps = new Model_Product();
$ps = $ps->find_all();
foreach ($ps as $p) {
$products[$p->id_product] = $p->title;
}
}
return $products;
}
示例3: __construct
function __construct(Request $request, Response $response)
{
$this->_filter_fields = array('id_user' => 'INPUT', 'pay_date' => 'DATE', 'created' => 'DATE', 'paymethod' => array('type' => 'DISTINCT', 'table' => 'orders', 'field' => 'paymethod'), 'id_product' => Model_Order::products(), 'status' => Model_Order::$statuses);
parent::__construct($request, $response);
$this->_buttons_actions = array(array('url' => Route::url('oc-panel', array('controller' => 'order', 'action' => 'pay')) . '/', 'title' => __('Mark as paid'), 'class' => '', 'icon' => 'fa fa-fw fa-usd'), array('url' => Route::url('oc-panel', array('controller' => 'profile', 'action' => 'order')) . '/', 'title' => __('See order'), 'class' => '', 'icon' => 'fa fa-fw fa-search'));
}
示例4: action_products
/**
* Handle GET requests.
*/
public function action_products()
{
try {
$this->rest_output(array('products' => Model_Order::products()));
} catch (Kohana_HTTP_Exception $khe) {
$this->_error($khe);
}
}