I would like to find out if my code is correct. It doesn't look right to me. The code is in response to part of an assignment which asks 3 things:
- Create Model Class file "booksmodel.php" i.e. "BooksModel".
- Add public method called save_books() to model class.
- Accept $_POST array as method argument.
This is my code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class BooksModel extends CI_Model {
public function save_books () {
$save_books = $_POST['BooksModel'];
}
}
?>
Accepting a Post Array as method is what confuses me and I can't seem to find clarification on it. Thanks for checking and any feedback.