-
Book Overview & Buying
-
Table Of Contents
Moodle 1.9 Extension Development
By :
The view.php file is responsible for displaying an individual activity and its interface. For our activity Foo! module, we have consolidated all of the functions into one page. In real world activities, it is common to see functions such as grading and reporting in separate PHP files.
Around line 15 of the view.php template, we need to include our submit form. We define the new form in the file submit_form.php.
The form file works almost identically to the add instance form that we covered earlier. We use this to display our response submission form. To create the form, we extend the moodleform class. SeeChapter 13, Building Forms with formslib for more information:
class foo_submit_form extends moodleform {
function definition() {
global $COURSE, $CFG;
Starting around line 71 of the view.php file in the NEWMODULE template, there is an echo statement, echo 'YOUR CODE GOES HERE'. Most of the work we need to do to view.php will...
Change the font size
Change margin width
Change background colour