Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ To create a form in Moodle, you create a class that defines the form, including
<summary>An example of a form definition</summary>

```php title="[path/to/plugin]/classes/form/myform.php"
<?php

namespace [plugintype]_[pluginname]\form;

// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");

class simplehtml_form extends moodleform {
class simplehtml_form extends \moodleform {
// Add elements to form.
public function definition() {
// A reference to the form is stored in $this->form.
Expand Down
6 changes: 5 additions & 1 deletion versioned_docs/version-4.1/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ To create a form in Moodle, you create a class that defines the form, including
<summary>An example of a form definition</summary>

```php title="[path/to/plugin]/classes/form/myform.php"
<?php

namespace [plugintype]_[pluginname]\form;

// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");

class simplehtml_form extends moodleform {
class simplehtml_form extends \moodleform {
// Add elements to form.
public function definition() {
// A reference to the form is stored in $this->form.
Expand Down
6 changes: 5 additions & 1 deletion versioned_docs/version-4.4/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ To create a form in Moodle, you create a class that defines the form, including
<summary>An example of a form definition</summary>

```php title="[path/to/plugin]/classes/form/myform.php"
<?php

namespace [plugintype]_[pluginname]\form;

// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");

class simplehtml_form extends moodleform {
class simplehtml_form extends \moodleform {
// Add elements to form.
public function definition() {
// A reference to the form is stored in $this->form.
Expand Down
6 changes: 5 additions & 1 deletion versioned_docs/version-4.5/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ To create a form in Moodle, you create a class that defines the form, including
<summary>An example of a form definition</summary>

```php title="[path/to/plugin]/classes/form/myform.php"
<?php

namespace [plugintype]_[pluginname]\form;

// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");

class simplehtml_form extends moodleform {
class simplehtml_form extends \moodleform {
// Add elements to form.
public function definition() {
// A reference to the form is stored in $this->form.
Expand Down
6 changes: 5 additions & 1 deletion versioned_docs/version-5.0/apis/subsystems/form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ To create a form in Moodle, you create a class that defines the form, including
<summary>An example of a form definition</summary>

```php title="[path/to/plugin]/classes/form/myform.php"
<?php

namespace [plugintype]_[pluginname]\form;

// moodleform is defined in formslib.php
require_once("$CFG->libdir/formslib.php");

class simplehtml_form extends moodleform {
class simplehtml_form extends \moodleform {
// Add elements to form.
public function definition() {
// A reference to the form is stored in $this->form.
Expand Down