Provides various official and user-released code examples and code reference. You are welcome to exchange and learn. layer is a well-known web bullet layer component. It has a comprehensive solution, we are committed to serving developers of various levels. Your pages can easily enjoy a rich and friendly operation experience.
IndexController. class. php code
Public function index (){ $ This-> user = M ('user')-> select (); $ This-> display (); }
// Add a topic Public function add (){ $ This-> display (); } // Save the column data Public function areate (){ If (M ('user')-> add ($ _ POST )){ $ This-> success ('added successfully! ', 'Index '); } Else { $ This-> error ('failed to add! '); } }
Public function edit (){ $ Id = $ _ GET ['id']; $ This-> user = M ('user')-> find ($ id ); $ This-> display (); } Public function updates (){ $ Data ['id'] = $ _ POST ['id']; $ Data ['username'] =_ _ POST ['username']; $ Arr-> data = M ('user')-> save ($ data ); If ($ arr> 0 ){ $ This-> success ('modification successful! ', 'Index '); } Else { $ This-> error ('modification failed! '); } }Index.html code
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.