当前位置: 首页>>代码示例>>PHP>>正文


PHP Menu::save方法代码示例

本文整理汇总了PHP中Menu::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::save方法的具体用法?PHP Menu::save怎么用?PHP Menu::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Menu的用法示例。


在下文中一共展示了Menu::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createnewmenu

 public function createnewmenu()
 {
     $menu = new Menu();
     $menu->name = Input::get("menuname");
     $menu->save();
     return json_encode(array("resp" => $menu->id));
 }
开发者ID:tvad911,项目名称:wmenu,代码行数:7,代码来源:WmenuContoller.php

示例2: run

 public function run()
 {
     DB::table('menus')->delete();
     DB::table('dish_menu')->delete();
     DB::table('recommendations')->delete();
     $menu = new Menu();
     $menu->menu_date = "2014-03-30";
     $menu->save();
     foreach (Dish::all() as $dish) {
         $menu->dishes()->save($dish);
     }
     $menu = new Menu();
     $menu->menu_date = "2014-04-23";
     $menu->save();
     foreach (Dish::all() as $dish) {
         $menu->dishes()->save($dish);
     }
     $recommendation = new Recommendation();
     $recommendation->menu_id = 1;
     $recommendation->recommendation = "Today, we has abcxyz for menu 1";
     $recommendation->save();
     $recommendation = new Recommendation();
     $recommendation->menu_id = 2;
     $recommendation->recommendation = "Today, we has abcxyz for menu 2";
     $recommendation->save();
 }
开发者ID:hlmasterchief,项目名称:lacrestaurant,代码行数:26,代码来源:MenuTableSeeder.php

示例3: save

 function save($id = FALSE)
 {
     if ($_POST) {
         if (isset($_POST['orderlist'])) {
             foreach ($_POST['orderlist'] as $key => $item) {
                 if ($item) {
                     $menu = new Menu(@$_POST['orderid'][$key]);
                     $menu->from_array(array('orderlist' => $item));
                     $menu->save();
                 }
             }
             set_notify('success', lang('save_data_complete'));
         } else {
             $menu = new Menu($id);
             if ($_FILES['icon']['name']) {
                 if ($id) {
                     $menu->delete_file('uploads/icon/', 'icon');
                 }
                 $_POST['icon'] = $menu->upload($_FILES['icon'], 'uploads/icon/', 24, 24);
             }
             $_POST['title'] = lang_encode($_POST['title']);
             $_POST['url'] = $_POST['url'];
             $_POST['user_id'] = $this->session->userdata('id');
             $menu->from_array($_POST);
             $menu->save();
             set_notify('success', lang('save_data_complete'));
         }
     }
     redirect('menus/admin/menus');
 }
开发者ID:unisexx,项目名称:thaigcd2015,代码行数:30,代码来源:menus.php

示例4: save

 public function save($id = null)
 {
     if (permission("menus", "create")) {
         if ($_POST) {
             $data = new Menu($id);
             $data->parent_id = $_POST["parent_id"];
             $data->title = $_POST["title"];
             switch (@$_POST["route"]) {
                 case 1:
                     $data->route = 1;
                     switch (@$_POST["s"]) {
                         case 'contents':
                             if ($_POST["g"]) {
                                 //	ตรวจสอบว่าเป็นค่าที่เลือกเป็นประเภทบทความหรือไม่
                                 $data->route_2 = $_POST["g"];
                                 $data->links = "contents?g=" . $_POST["g"];
                             } else {
                                 //	ถ้าไม่ได้เลือกประเภทบทความจะไปที่หน้ารวมบทความทั้งหมด
                                 $data->links = "contents";
                             }
                             break;
                         case 'p':
                             if (@$_POST["g"]) {
                                 //	ตรวจสอบว่าเป็นค่าที่เลือกเป็นประเภทบทความหรือไม่
                                 $data->route_2 = "p";
                                 $data->links = "p/" . $_POST["g"];
                             }
                             break;
                         default:
                             $data->links = $_POST["s"];
                             break;
                     }
                     break;
                 case 2:
                     $data->route = 2;
                     $data->links = $_POST["links"];
                     break;
                 case 3:
                     $data->route = 3;
                     $data->detail = $_POST["detail"];
                     break;
                 default:
                     $data->route = 2;
                     $data->links = "#";
                     break;
             }
             $data->save();
             $type = $id ? 'edit' : 'add';
             // for logs.
             save_logs($type, $data->id);
             if (@$_POST["route"] == 3) {
                 $data->slug = clean_url($_POST["title"]) . "-" . $data->id;
                 $data->save();
             }
         }
     }
     redirect("admin/menus");
 }
开发者ID:ultraauchz,项目名称:asean_cultural_mapping,代码行数:58,代码来源:menus.php

示例5: registrar

 public static function registrar($texto)
 {
     $menu = new Menu();
     $menu->texto = $texto;
     $menu->abierto = "SI";
     $menu->activo = "SI";
     $menu->save();
     return $menu;
 }
开发者ID:raalveco,项目名称:temporal,代码行数:9,代码来源:menu.php

示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $subMenu = new Menu();
     $subMenu->id = 10;
     $subMenu->descricao = "Setor";
     $subMenu->menu_pai = 2;
     $subMenu->url = '/cadastro/setors/';
     $subMenu->save();
 }
开发者ID:kuell,项目名称:buriti,代码行数:14,代码来源:SetorTableSeeder.php

示例7: run

 public function run()
 {
     $model = new Menu();
     if (isset($_POST['Menu'])) {
         $model->attributes = $_POST['Menu'];
         if ($model->save()) {
             $this->controller->redirect(array('index'));
         }
     }
     $this->controller->render('create', array('model' => $model));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:11,代码来源:CreateAction.php

示例8: add

 public function add()
 {
     $input = Request::all();
     $menu = new Menu();
     $menu->menu = $input['menu_nombre'];
     $menu->url = $input['menu_url'];
     $menu->padre_id = $input['menu_padre_id'];
     $menu->save();
     return redirect('listMenu');
     //->back();
 }
开发者ID:guiles00,项目名称:acfj,代码行数:11,代码来源:AreaNotificacionController.php

示例9: createMenu

 /**
  * Cria um novo menu
  * @param  string $menu_icon             nome do novo icone, pode ser referente a glyphicons do bootstrap(http://getbootstrap.com/components/)
  * ou os icônes do font awesome (http://fortawesome.github.io/Font-Awesome/3.2.1/icons/)
  * @param  string $menu_name             nome do menu
  * @param  string $menu_href             Endereço que deve acessar
  * @param  int $menu_level_permission    Nível de permissão do menu
  * @return int                        id do menu inserido
  */
 public function createMenu($menu_icon, $menu_name, $menu_href, $menu_level_permission, $menu_active)
 {
     $menu = new Menu();
     $menu->menu_icon = $menu_icon;
     $menu->menu_name = $menu_name;
     $menu->menu_href = $menu_href;
     $menu->menu_level_permission = $menu_level_permission;
     $menu->menu_active = $menu_active;
     $menu->save();
     return $menu->menu_id;
 }
开发者ID:viniciusilveira,项目名称:pluton,代码行数:20,代码来源:Menu.php

示例10: postNew

 public function postNew()
 {
     // Create a new menu item and save it
     $item = new Menu();
     $item->title = e(Input::get('title', 'untitled'));
     $item->label = e(Input::get('label', ''));
     $item->url = e(Input::get('url', ''));
     $item->order = Menu::max('order') + 1;
     $item->save();
     return Redirect::to('admin/menu');
 }
开发者ID:basuritas-laravel,项目名称:laravel-shop-menu,代码行数:11,代码来源:MenuController.php

示例11: actionCreate

 /**
  * Создает новую модель меню.
  * Если создание прошло успешно - перенаправляет на просмотр.
  */
 public function actionCreate()
 {
     $model = new Menu();
     if (($data = Yii::app()->getRequest()->getPost('Menu')) !== null) {
         $model->setAttributes($data);
         if ($model->save()) {
             Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('MenuModule.menu', 'Menu was created!'));
             $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create']));
         }
     }
     $this->render('create', ['model' => $model]);
 }
开发者ID:syrexby,项目名称:domovoishop.by,代码行数:16,代码来源:MenuBackendController.php

示例12: actionCreate

 /**
  * 添加菜单
  *
  */
 public function actionCreate()
 {
     $model = new Menu();
     if (isset($_POST['Menu'])) {
         $model->attributes = $_POST['Menu'];
         if ($model->save()) {
             $this->redirect(array('index'));
         }
     }
     $parentId = intval($_GET['id']);
     $this->render('create', array('model' => $model, 'parentId' => $parentId));
 }
开发者ID:redtreelchao,项目名称:wander-moon,代码行数:16,代码来源:MenuController.php

示例13: addMenu

 /**
  * 添加菜单
  *
  * 对应API
  * 请求类型:POST
  * @return array 执行状态
  */
 public function addMenu()
 {
     $menu = new Menu();
     $menu->shop_id = Input::get('shop_id');
     $menu->group_id = Input::get('group_id');
     $menu->title = Input::get('title');
     $menu->price = Input::get('price');
     $menu->pic = Input::get('pic');
     $menu->pic_small = Input::get('pic_small');
     $menu->state = Input::get('state');
     $menu->save();
 }
开发者ID:uwitec,项目名称:haochigo_business,代码行数:19,代码来源:ShopController.php

示例14: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $menu = new Menu();
     $menu->descricao = "Ordem Interna";
     $menu->id = 8;
     $menuId = $menu->save();
     $subMenu = new Menu();
     $subMenu->id = 9;
     $subMenu->descricao = "Inclusão de Ordem Interna";
     $subMenu->menu_pai = 8;
     $subMenu->url = 'osi';
     $subMenu->save();
 }
开发者ID:kuell,项目名称:buriti,代码行数:18,代码来源:OrdemInternaSeeder.php

示例15: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Menu();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Menu'])) {
         $model->attributes = $_POST['Menu'];
         if ($model->save()) {
             $this->redirect(array('index'));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:vuvankhai,项目名称:itplus,代码行数:17,代码来源:MenuController.php


注:本文中的Menu::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。