當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Factory::names方法代碼示例

本文整理匯總了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:
開發者ID:name3,項目名稱:cheng,代碼行數:31,代碼來源:order.php

示例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();
開發者ID:name3,項目名稱:cheng,代碼行數:31,代碼來源:test.php


注:本文中的Factory::names方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。