-
Which method is used to redirect users to a different URL in CodeIgniter?
- A)
redirect()
- B)
forward()
- C)
navigate()
- D)
move()
Answer: A)
redirect()
- A)
-
What is the purpose of the
routes.php
file in a CodeIgniter project?- A) To define custom routes for URLs
- B) To configure database connections
- C) To specify controller methods for handling requests
- D) To set up environment-specific configurations
Answer: A) To define custom routes for URLs
-
Which CodeIgniter library is used for file uploading?
- A) File_Loader
- B) Upload_Library
- C) File_Uploading
- D) File_Upload
Answer: D) File_Upload
-
What is the purpose of the
validation_errors()
function in CodeIgniter?- A) To display validation errors in a view
- B) To retrieve validation rules from the database
- C) To log validation errors in a file
- D) To set custom validation error messages
Answer: A) To display validation errors in a view
-
Which method is used to set cookies in CodeIgniter?
- A)
$this->cookie->set()
- B)
$this->set_cookie()
- C)
$this->input->set_cookie()
- D)
$this->input->cookie()
Answer: C)
$this->input->set_cookie()
- A)
-
What is the purpose of the
csrf_protection
setting in the CodeIgniter configuration?- A) To enable cross-site request forgery (CSRF) protection
- B) To configure the session driver for CSRF protection
- C) To define custom CSRF tokens
- D) CSRF protection is enabled by default in CodeIgniter
Answer: A) To enable cross-site request forgery (CSRF) protection
-
Which of the following methods is used to encrypt data in CodeIgniter?
- A)
encrypt()
- B)
encrypt_data()
- C)
encrypt_string()
- D)
encode()
Answer: C)
encrypt_string()
- A)
-
How do you enable query caching in CodeIgniter?
- A) By setting the
cache_query
configuration option toTRUE
- B) By calling the
cache_query()
method in the controller - C) By configuring the database driver to enable caching
- D) Query caching is enabled by default in CodeIgniter
Answer: C) By configuring the database driver to enable caching
- A) By setting the
-
Which CodeIgniter feature allows you to execute custom code at specific points during the request lifecycle?
- A) Hooks
- B) Middleware
- C) Interceptors
- D) Filters
Answer: A) Hooks
-
How do you enable logging in CodeIgniter?
- A) By setting the
log_enabled
configuration option toTRUE
- B) By calling the
enable_log()
method in the controller - C) By configuring the logging threshold in the
config.php
file - D) Logging is enabled by default in CodeIgniter
Answer: C) By configuring the logging threshold in the
config.php
file - A) By setting the
Comments