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


PHP Contact::destroy方法代码示例

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


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

示例1: destroy

 function destroy($params)
 {
     if (empty($params['id'])) {
         bail('Required parameter id not set.');
     }
     $contact = new Contact($params['id']);
     $contact->destroy();
     $this->redirectTo(array('controller' => 'Contact', 'action' => 'index'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:ContactController.php

示例2: set_destroy_post

 public function set_destroy_post()
 {
     $ContactList = new ObjList(['db_where_Arr' => ['status' => -1], 'db_where_deletenull_Bln' => TRUE, 'model_name_Str' => 'Contact', 'limitstart_Num' => 0, 'limitcount_Num' => 100]);
     foreach ($ContactList->obj_Arr as $key => $value_contact) {
         $Contact = new Contact(['contactid_Num' => $value_contact->contactid_Num]);
         $Contact->destroy();
     }
     if (!empty($ContactList->obj_Arr)) {
         $this->load->model('Message');
         $this->Message->show(['message' => '銷毀成功', 'url' => 'admin/base/contact/set/set']);
     } else {
         $this->load->model('Message');
         $this->Message->show(['message' => '已無可銷毀的項目', 'url' => 'admin/base/contact/set/set']);
     }
 }
开发者ID:fansWoo,项目名称:win_the_world,代码行数:15,代码来源:Set.php

示例3: destroy

 public function destroy($id)
 {
     Contact::destroy($id);
     return Response::json(["status" => "OK"]);
 }
开发者ID:cssailing,项目名称:workshop-laravel,代码行数:5,代码来源:ContactController.php

示例4: Address

    if ($checkEmail == 0) {
        if ($newContact->save()) {
            $newAddress = new Address();
            $newAddress->contactId = $newContact->id;
            $newAddress->zipcode = $zipcode;
            $newAddress->address = $address;
            $newAddress->complement = $complement;
            $newAddress->neighborhood = $neighborhood;
            $newAddress->city = $city;
            $newAddress->state = $state;
            if ($newAddress->save()) {
                $data['msg'] = 'Contact saved successfully!';
                $data['id'] = $newContact->id;
            } else {
                $data['msg'] = 'An error occurred while saving the contact!';
                Contact::destroy($newContact->id);
            }
        } else {
            $data['msg'] = 'An error occurred while saving the contact!';
        }
    } else {
        $data['msg'] = 'This email is already registered for a contact!';
    }
    $contactList->response()->header('Content-Type', 'application/json');
    echo json_encode($data);
});
// Edit contact
$contactList->put("/contacts/:id", function ($id) use($contactList) {
    $name = $contactList->request->params('name');
    $email = $contactList->request->params('email');
    $editContact = Contact::find($id);
开发者ID:vitorm11,项目名称:contactlist,代码行数:31,代码来源:index.php

示例5: destroy

 /**
  * Remove the specified Contact from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Contact::destroy($id);
     return Redirect::route('admin.contacts.index')->with('message', 'Data deleted successfully');
 }
开发者ID:arbuuuud,项目名称:gnt-aops,代码行数:11,代码来源:ContactsController.php

示例6: getDelete

 /**
  * Remove the specified resource from storage.
  * DELETE /admin\admincontact/{id}
  *
  * @param  int $id
  * @return Response
  */
 public function getDelete($id)
 {
     $delete = Contact::destroy($id);
     Session::flash('message', 'Contact has been deleted Successfully');
     return Redirect::to('admin/contacts');
 }
开发者ID:arif04cuet,项目名称:Laravel-4-Bootstrap-Starter-Site,代码行数:13,代码来源:AdminContactController.php


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