本文整理汇总了PHP中Factory::names方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::names方法的具体用法?PHP Factory::names怎么用?PHP Factory::names使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Factory
的用法示例。
在下文中一共展示了Factory::names方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smart_view
$price = $order->priceData('customer');
$view_name = 'order.price';
include smart_view('append.div');
exit;
break;
default:
throw new Exception("unkown action: {$action}");
break;
}
}
$customer = $customer->id;
// for next
break;
case 'Admin':
case 'SuperAdmin':
$factories = Factory::names();
// get some divs
if ($by_ajax && is_numeric($target) && preg_match('/get_.+_div/', $action)) {
include FrameFile::controller('order.get_div');
exit;
}
// 对订单的操作,通过表单post过来的
if ($action && $by_post && is_numeric($target)) {
include FrameFile::controller('order.control');
exit;
}
list($customer, $username, $factory) = _get('customer', 'username', 'factory');
$conds = array_merge($conds, compact('username', 'factory'));
$page['styles'][] = 'admin';
break;
default:
示例2: array
$superadmin = $user->instance();
$admin = $superadmin->createAdmin(compact('username', 'password'));
$ideal_arr = array('name' => $username, 'password' => md5($password), 'type' => 'Admin');
$id = Pdb::lastInsertId();
$real_arr = Pdb::fetchRow('name, password, type', User::$table, array('id=?' => $id));
test($real_arr, $ideal_arr, array('name' => 'Super Admin create Admin, db'));
// case 6 Admin update gold Price
begin_test();
$admin->updatePrice('PT950', '1903.21');
$admin->updatePrice('Au750', '1723.45');
test(1, 1, array('name' => 'Admin update gold Price'));
// case 7 Admin add Factory
begin_test();
$info = array('name' => '嘉黛_test', 'contact' => '吴小牛', 'phone' => '13526523659', 'qq' => '5833652584', 'city' => '湖北武汉');
$factory = $admin->addFactory($info);
test(count(Factory::names()), 1, array('name' => 'Admin add Factory'));
// case 8 Admin post Product, db
begin_test();
$prd_types = Product::types();
$info = array('name' => '唯爱心形群镶女戒_test', 'type' => reset(array_keys($prd_types)), 'material' => json_encode(array('PT950', '白18K金', '黄18K金', '红18K金')), 'rabbet_start' => '0.30', 'rabbet_end' => '0.60', 'small_stone' => 3, 'st_weight' => 2.1, 'image1_400' => '/test/static/img/i400-1.jpg', 'image2_400' => '/test/static/img/i400-2.jpg', 'image3_400' => '/test/static/img/i400-3.jpg', 'image1_thumb' => '/test/static/img/i80-1.jpg', 'image2_thumb' => '/test/static/img/i80-2.jpg', 'image3_thumb' => '/test/static/img/i80-3.jpg');
$product = $admin->postProduct($info);
// add more
// for ($i=0; $i < 50; $i++) {
// $info2 = $info;
// $info2['name'] = $info['name'] . $i;
// $admin->postProduct($info2);
// }
// but what if we count?
test(Pdb::fetchRow('*', Product::$table, array('id=?' => $product->id)), $info, array('name' => 'Admin post Product, db', 'compare' => 'in'));
// case 9 Admin del Product
begin_test();