How can you specify a table in a Model to interact with?
Group of answer choices
protected $table property
setTable()
useTable()
table()
protected $table property
What is the primary purpose of a Model in CodeIgniter?
Group of answer choices
Interact with the database
Configure routing
Handle user input
Manage views
Interact with the database
Which method is commonly used to retrieve all records from a database table using a Model?
Group of answer choices
findAll()
getAll()
retrieveAll()
get()
findAll()
Which property should be defined in a Model to specify the primary key of the table?
Group of answer choices
protected $primaryKey
protected $id
protected $key
protected $identifier
protected $primaryKey
What is the default return type of data when using Models in CodeIgniter?
Group of answer choices
Array
JSON
Object
XML
Array
How can you pass multiple pieces of data to a view?
Group of answer choices
Using an associative array
Using JSON
Using multiple arguments
Using a string
Using an associate array
Which of the following is true about views in CodeIgniter?
Group of answer choices
Views should only present data, not handle logic
Views should contain database queries
Views can directly manipulate session data
Views should handle form validation
Views should only present data, not handle logic
Which function is used to load a view in CodeIgniter?
Group of answer choices
view()
load->view()
display_view()
show_view()
view()
What does the view() function return when loading a view?
Group of answer choices
A string containing the rendered view
Nothing
A boolean
An array
A string containing the rendered view
What is the primary purpose of a View in CodeIgniter?
Group of answer choices
Present data to the user
Handle database queries
Manage application logic
Route HTTP requests
Present date to the user
Which method in a Model is used to update an existing record in the database?
Group of answer choices
update()
set()
modify()
change()
update()
Which function is used to load a Model in CodeIgniter?
Group of answer choices
model()
get_model()
load->model()
use_model()
model()
What does the save() method do in a Model?
Inserts or updates data based on whether the record exists
Only inserts data into the database
Only updates data in the database
Deletes a record if it exists
Inserts or updates data based on whether the record exists
How do you validate data before saving it in a Model?
Group of answer choices
Use the $validationRules property
validateData()
checkData()
validateBeforeSave()
Use the $validationRules property
Which of the following functions can be used to include a CSS file in a view?
Group of answer choices
<link></link>
<link></link>
add_css(‘…’)
load_css(‘…’)
<link></link>
What is the purpose of using layouts in CodeIgniter views?
Group of answer choices
To create a consistent structure across multiple pages
To load multiple models
To handle database connections
To route user requests
To create a consistent structure across multiple pages
Which method is used to render a view as a partial within another view?
Group of answer choices
view()
include()
render_partial()
embed_view()
view()
Which method can be used to get the number of affected rows from the last database operation?
Group of answer choices
affectedRows()
rowCount()
countRows()
getRowCount()
affectedRows()
Which method in a Model can be used to insert a new record into the database?
Group of answer choices
insert()
add()
saveData()
create()
insert()
How do you prevent direct access to view files via URL?
Group of answer choices
Use an .htaccess rule
Set permissions on the file
Rename the file to .view
Load the view using AJAX only
Use an. htaccess rule