We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

How we delete the data using module

Development and Programming

hbsinternet's avatar
hbsinternet
24 posts
9 years ago
hbsinternet's avatar hbsinternet

Hi All

My requirement is, how we delete table row using module.

I have create a module “abc_module” and I have added function “delete_data()” under this module. Code is below

$_id = ee()->uri->segment(3);   
  $_delete_data = ee()->model_name->delete_attendee($_id); 
  if($_delete_data == TRUE){
   ee()->functions->redirect(ee()->functions->fetch_current_uri());
  } else {
   
  }

I have create a template “list” where I am dispalying a list of data. Code is below:

{exp:abc_module:abc_list paginate="bottom" limit="100" order_by="id"}
<tr>
 <td>{count}</td>
 <td>{id}</td>
 <td>{firstname}</td>
 <td>{lastname}</td>
 <td>{email}</td>
 <td><a href="http://{path=abc_module/delete_data}/{id}">Delete</a></td>
</tr>
{/exp:abc_module:abc_list}

But it’s not working, actually I am trying to do the same way like codeignitor.

Example:

In Module : “/module_name/functionname/”

In codeignitor : “/controller_name/functionname/”

Please check and advise

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.