本文整理匯總了PHP中Unit::toArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Unit::toArray方法的具體用法?PHP Unit::toArray怎麽用?PHP Unit::toArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Unit
的用法示例。
在下文中一共展示了Unit::toArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit_dish
public function edit_dish($idDish = null)
{
$flash_string = '';
if (Session::exists('account')) {
$flash_string = Session::flash('account');
}
$user = new User();
if ($user->isLoggedIn()) {
if (isset($idDish)) {
$dish = Dish::toArray($idRecipe);
$units = Unit::toArray();
$product = Product::toArray();
$this->view('account/dish_edit', ['register' => true, 'loggedIn' => 1, 'flash' => $flash_string, 'name' => $user->data()->name, 'page_name' => "Edit dish", 'products' => json_encode($product), 'user_id' => $user->data()->id, 'dish' => json_encode($dish), 'units' => json_encode($units)]);
} else {
Redirect::to('account/dishes');
}
} else {
Session::flash('home', 'You have been logged out, please log back in');
Redirect::to('home');
}
}