ExamVeda
Login
Home
51
What does the getInputHtml() return?
Discuss
Answer & Solution
Answer: Option B
Solution:
The method getInputHtml() returns a fieldtype’s input HTML.
52
How many arguments does the getInputHtml() accept?
Discuss
Answer & Solution
Answer: Option B
Solution:
The method getInputHtml(0 accepts two arguments: $name and $value. $name is the name you should assign your HTML input’s name= attribute, and $value is the field’s current value (either from the DB, or the POST data if there was a validation error).
53
Which is the method used to process on the input’s post data before it is saved to the database?
Discuss
Answer & Solution
Answer: Option D
Solution:
If you need to do any processing on your settings’ post data before they’re saved to the database’s content table, you can do it with the prepSettings() method.
54
What is the purpose of the parameter $name ?
Discuss
Answer & Solution
Answer: Option B
Solution:
The parameter $name is the name you should assign your HTML input’s name= attribute.
55
What does the method defineSettings() return?
Discuss
Answer & Solution
Answer: Option A
Solution:
The defineSettings() method returns an array whose keys define the setting names, and values define the parameters (the type of value, etc.).
56
What is the purpose of the parameter $value?
Discuss
Answer & Solution
Answer: Option C
Solution:
The parameter $value is the field’s current value (either from the DB, or the POST data if there was a validation error).
57
When does the defineContentAttribute() method return a false?
Discuss
Answer & Solution
Answer: Option B
Solution:
If your fieldtype is storing data in its own table, and doesn’t have any use for a column within the main content table, you may also set defineContentAttribute() to return false.
58
How many events does the BaseFieldType provide?
Discuss
Answer & Solution
Answer: Option C
Solution:
BaseFieldType provides three events that you can latch code onto:
1. onBeforeSave() : Called right before a field is saved.
2. onAfterSave() : Called right after a field is saved, and $this->model->id is set.
3. onAfterElementSave() : Called right after an element is saved, and $this->element->id is set.
59
Which method is called right before a field is saved?
Discuss
Answer & Solution
Answer: Option A
Solution:
The method onBeforeSave() is called right before a field is saved.
60
Which of the following are JavaScript logging library?
Discuss
Answer & Solution
Answer: Option B
Solution:
loglevel is a JavaScript logging library that is reliable and extremeley easy-to-use over the various console.log() methods.