Thursday 5 January 2017

60 TOP Codeigniter Multiple choice Questions and Answers pdf download

Codeigniter Multiple choice Questions
The Below List of all Codeigniter MCQs and all Codeigniter framework online quiz questions are prepared by experts, Latest 60 top Codeigniter multiple choice questions and answers PDF for freshers and experienced job seekers.

Codeigniter Objective type Questions and Answers List

1.  Base URL can be changed from which configuration file:
a. database            
b. config                  
c. routes                  
d. autoload
Ans: B

2. default controller can be set from which configuration file:
a. database            
b. config                  
c. routes                  
d. autoload
Ans: C

3. Which configuration file is used to autoload resources?
a. database            
b. config                  
c. routes                  
d. autoload
Ans: D

4. Which one is the business logic in codeigniter?
a. model                  
b. view                                
c. controller            
d. helper
Ans: C

5. Which of the following in MVC can connect to database?
a. model                  
b. view                                
c. controller            
d. helper
Ans: A,C

6.  In CI, the closing tag of PHP is optional.
a. true                                  
b. false
Ans: A

7. Which are false?
a. all codeigniter class name should start with uppercase and rest of the name should be in lowercase.
b. you can remap function calls by using a function in your controller called _remap()
c. view file cannot call other view files
d. you can pass data to a view file by using the third parameter of the load->view function.
Ans: C,D

8. Which variable name is incorrect?
a. $Text                    
b. $f              
c. $user id                
d.$text                      
e. $some-test-here
Ans: A,B,C,E

9. The keywords true, false, null should always be in lowercase letter in codeigniter.
a. true                      
b. fasle
Ans: B

10. What kind of link is this:
a. URI            
b. QueryString                    
c. ftp link
Ans: A

11. The above URl is built on segments.            
A. true                      
B. false
Ans: A

12. Which one will be treated as parameter in that URI?
a. index.php            
b. somethingvone
c. somethingvtwo
d. somethingvthree
Ans: D

13. Which one will be treated as method in that URI?
a. index.php            
b. somethingvone
c. somethingvtwo
d. somethingvthree
Ans: C

14. Which one will be treated as controller in that URI?
a. index.php            
b. somethingvone
c. somethingvtwo
d. somethingvthree
Ans: B

15. Which one will control all the segments?
a. index.php            
b. somethingvone
c. somethingvtwo
d. somethingvthree
Ans: A

16. Which are true:
a. helper can only be loaded in controller and model. View cannot load helper
b. we cannot load multiple helper  by passing an array of values to the first parameter.
c. Plugins are stored within system/application/plugins/ folder.
d. all codeigniter core libraries have the prefix CI_
Ans: C

17. Libraries are created so that they can be reused whenever needed.
a. true                      
b. false
Ans: A

18. Benchmark can be added to model, view and controllers
a. true                      
b. false
Ans: A

19.   You can display the amount of memory used by the system by calling:
a. $this->benchmark->memory_use()
b. $this->memory_use()
c.  $this->benchmark->memory_usage()
d.  $this->memory_usage()
Ans: C

20. Which one is not true
a. we can set automatic filtering on by setting $config[‘global_xss_filtering’] to TRUE
b. We can check image for safety in optional second parameter to the xss clean function
c. The email class also serves as a wrapper class in CI
d. email can only be sent from controller
Ans: D

21. Which function is use to set the value of form input box ?
(a)    setvalue()
(b)    set()
(c)    set_value()
(d)    Non of above
Ans: C

22. How many parameters are set_rules function ?
(a)    4
(b)    3
(c)    2
(d)    5
Ans: B

23.Which is  extremely useful and even though also optional ?
(a)    Model
(b)    View
(c)    Controller
(d)    Non of above
Ans: A

24. Which refers to the system of numbering pages-a list of numbered links ?
(a)    Rotating
(b)    Pagination
(c)    Cropping
(d)    All of above
Ans: B

25. What correct line of coded loading a view ?
(a)    $this->load->view(‘view_name’)
(b)    $this->view(‘view_name’)
(c)    $this->load(‘view_name’)
(d)    $this->load->view_name(‘view’)
Ans: A

26. What work in almost exactly the same way as Helpers ?
(a)    Helper
(b)    Plugin
(c)    Library
(d)    All of above
Ans: B

27.Which class is used to calculate the time between two points in your application ?
(a)    Profiling class
(b)    Security class
(c)    Benchmarking class
(d)    Non of above
Ans: C

28.Which key word is used callback function ?
(a)    _callback
(b)    callback_
(c)    _callback_
(d)    Non of above
Ans: B

29. Which of the following is/are fasle:
a. The third parameter in load->view function used for output buffering
b. The default batch size for bcc is 500
c. we can store data in session by calling set_userdata() method
d. to validate form we use the form library in CI.
Ans: B,D

30. CI session contains the following:
a. Session_ID
b. users IP address
c. user manager
d. first activity timestamp
Ans: A,B,C

31. _______ is an Application Development Framework - a toolkit - for people who build web sites using PHP.
A.      Joomla
B.      Zend
C.      CodeIgniter
D.      Wordpress
Ans: C

32.       Which statement is true about the View?
A.      A View is simply a class file that is named in a way that can be associated with a URI
B.      A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc
C.      A view is simply a PHP Code, add a different type of function
Ans: B

33.       Which statement is true about the Controller?
A. A Controller is simply a class file that is named in a way that can be associated with a URI
B.      A Controller is simply a web page, or a page fragment, like a header, footer, sidebar, etc
Models are PHP classes that are designed to work with information in your database
Ans: A

34.       Which statement is true about the Modules?
A.  A Models is simply a class file that is named in a way that can be associated with a URI
B. A Models is simply a web page, or a page fragment, like a header, footer, sidebar, etc
C. Models are PHP classes that are designed to work with information in your database
Ans: C

35.       Helper file is simply a collection of functions in a particular category.
A.      True
B. Flase
Ans: A

36.       How to load a helper file using the following function?
A.  $load->helper('name');
B.  $Loding->load->helper('name');
C.  $this->load->helper('name');
Ans: C

37.       Which of the following line of code use to   a  send email?
A.      library('email');
Mail details code here
 $this->email->send();
B.      $this->load->library('email');
Mail details code here
 $this->email->send();
C.      $this->load->email;
Mail details code here….
 $this->email->send();
Ans: B

38.       Which of the following code loads and initializes the database class based on your configuration settings?
A.      $this->load->DataFile();
B.      $this->load->DatabaseName();
C.      $this-> database();
D.      $this->load->database();
Ans: D

39.       Which of the following code is example of query?
A.  $this->db-> ('SELECT name, title, email FROM my_table');
B.   $this->db->query('SELECT name, title, email FROM my_table');
C.  $query = $this->db->query('SELECT name, title, email FROM my_table');
Ans: C

40.   Which class allows information to be retrieved, inserted, and updated in your database with minimal scripting?
A.      Active Record Class
B.      Helper class
C.      Database Class
D.      URI class
Ans: A

41.   _________ Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table.
A.      $this->db->getAll()
B.      $this->db->get()
C.      $this->db->getQuery()
Ans: B

42.   How to get the average age from a Employee table?
A.      $this->db->select_avg('age');
B.      $this->db->avg('age');
C.      $this-> select_avg('age');
Ans: A

43. Base URL can be changed from which configuration file:
A. database          
B. config                
C. routes                
D. autoload
Ans: B

44. default controller can be set from which configuration file:
A. database          
B. config                
C. routes                
D. autoload
Ans: C

45. Which one is the business logic in codeigniter?
A. model            
B. view                                
C. controller          
 D. helper
Ans: A

46. Which of the following in MVC can connect to database?
A. model                
B. view                                
C. controller          
D. helper
Ans: A

47. In CI, the closing tag of PHP is optional.
A true                                
B. false
Ans: A

48. Which function is use to set the value of form input box ?
A.    setvalue()  
B.    set()
C.     set_value()  
D.     Non of above
Ans: C

49. What correct line of coded loading a view ?
A.    $this->load->view(‘view_name’)
B.    $this->view(‘view_name’)
C.    $this->load(‘view_name’)
D.    $this->load->view_name(‘view’)
Ans: A

50.Which variable name is incorrect?
A. $Text
 B. $f            
C. $user id              
D.$A-myVariable
Ans: A, D, C

51. How to initialized upload class in our controller?
A. $this->load->helper('upload');
B. $this->load->Uploading('upload');
C. $this->load->'upload';
D. $this->load->library('upload');
Ans: D

52. Which function gives you to view file friendly syntax to get browser cookies?
A. get_cookie()
B. list_cookie()
C. dis_cookie()
D. set_cookie()
Ans: A

53. How to  creates an opening form tag with a base URL built from your config preferences?
A. echo form_fopen('email/send');
B. echo form('email/send');
C. echo form_open('email/send');
D. echo open('email/send');
Ans: C

54. Which rules returns FALSE if the form element is empty?
A. required
B.  compulsory
C. Empty
Ans: A

55. Which rules returns FALSE if the form element contains anything other than alpha-numeric characters.?
A. alpha
B.  numeric
C. alpha_numeric
Ans: C

56. Which rules returns FALSE if the form element does not contain a valid email address.?
A. email
B.  valid_email
C. alpha_numeric
Ans: B

57. How to update data using Active Record Pattern?
A. $this->db->updated('mytable', $object);
B. $this->db->ActiveRecord('mytable', $object);
C. $this->db->update('mytable', $object);
D. $this->db->updateData('mytable', $object);
Ans: C

58. CodeIgniter is fairly restrictive regarding which characters it allows in your URI strings in order to help minimize the possibility that malicious data can be passed to your application.
A.  Alpha-numeric text
B. Tilde: ~
C.  Period: .
D. Hypen -
Ans: A,B,C

59. The _________ class permits you maintain a user's "state" and track their activity while they browse your site.
A. loader
B. Session
C. Cookie
D. Header
Ans: B

60. How to initializing the Session?
A. $this->load->session();
B. $this->library('session');
C. $this->load->Session['session'];
D. $this->load->library('session');
Ans: D