CodeIgniter

CodeIgniter

Test your CodeIgniter knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. Which folder contains the controllers in CodeIgniter?

    • /views
    • /models
    • /controllers
    • /config
  2. What architecture does CodeIgniter follow?

    • MVVM
    • MVC
    • MVP
    • MVW
  3. What file is used to configure database settings?

    • database.php
    • db.php
    • config.php
    • routes.php
  4. Which method loads a view in a controller?

    • $this->view()
    • $this->load->view()
    • $this->load_view()
    • $this->show_view()
  5. What is the default controller file name in CodeIgniter?

    • home.php
    • index.php
    • welcome.php
    • main.php
  6. Which method allows defining custom routes?

    • $route['name'] = 'controller/method';
    • $route->set('name', 'controller/method');
    • $this->route->add('name', 'controller/method');
    • $route->define('name', 'controller/method');
  7. How to pass data from controller to view?

    • Using $this->load->data()
    • Using $this->load->view('view', $data)
    • Using $this->view->set_data($data)
    • Using $this->data->load()
  8. Which method deletes a session variable?

    • $this->session->unset_userdata('key')
    • $this->session->delete('key')
    • $this->session->remove('key')
    • $this->session->destroy('key')
  9. What does the ‘autoload.php’ file do?

    • Autoloads libraries, helpers, and models
    • Autoloads only controllers
    • Autoloads only views
    • Autoloads database drivers only
  10. Which helper assists with URL creation?

    • url_helper
    • form_helper
    • html_helper
    • cookie_helper
  11. What is the default namespace for controllers in CodeIgniter 4?

    • App\Controllers
    • Controllers\App
    • CodeIgniter\Controllers
    • App\Libraries
  12. Which feature allows you to autoload classes based on namespaces?

    • PSR-4 Autoloading
    • Classmap Autoloading
    • Legacy Autoloading
    • Composer Autoloading
  13. What are entities in CodeIgniter 4 used for?

    • Represent data models with getters and setters
    • Manage views
    • Handle routing
    • Store session data
  14. What is a migration in CodeIgniter?

    • A class to manage database schema changes
    • A form validation rule
    • A type of controller
    • A session method
  15. Which command rolls back the last migration?

    • php spark migrate:rollback
    • php spark rollback:migrate
    • php spark migrate:reset
    • php spark rollback