FuelPHP Interview Questions and Answers
Most Frequently Asked FuelPHP Interview Questions
DB::select('name')->from('admin')->execute();
The term Scaffolding is a meta-data programming method needed for building database operations. The scaffolding of the concept FuelPHP which makes the work easy and helpful in allowing to get a basic CRUD application that too following simple and easy steps. It is one of the common FuelPHP Interview Questions.
1. Create an object.
2. Instantiate it, $val = Validation::forge('my_validation');
3. Start adding fields to it, $val = Validation::forge('my_validation');
4. Add username to it, $val->add('username', 'Your username')->add_rule;
5. Add column for password, $val->add('password', 'Your password')
->add_rule('required')
->add_rule('min_length', 3)
->add_rule('max_length', 10);
(The digits are as per the requirements)
6. Add the next field, the gender field- $val->add('gender', 'Your gender')-
>add_rule('required')
->add_rule('match_collection', array('M', 'F'));
If any other validations are to be given, then give them using add_rule() method.
Or
Forge ( ) method is used for creating a validating objects, such as $val= Validation:: forge( );
Checking an Ajax request on the server is a task which can be done with the help of input class method. If there has been an Ajax request on the server, then the function, Input::is_ajax will return true, and in the otherwise case, it will return false.
if (Input::is_ajax()) {
// Ajax request
} else {
// Normal request
}
- Base controller
- Rest controller
- Hybrid controller
- Template controller
- Create ()- Used for creating a new session.
- Set ()- Used for assigning a session variable.
- Destroy ()- Destroying the existing session is the main task of this method.
- Get ()- it gets the sessions variable.
- Delete ()- It deletes the stored variable which has been retrieved from the sessions.