Moodle plugin developer tutorial - create a moodle form #4
HTML-код
- Опубликовано: 20 авг 2020
- Here we create a new form. This is a class that extends the core moodleform class. We then instantiate it in a new 'edit' page.
Moodle docs:
docs.moodle.org/dev/Form_API
You can get the code here: github.com/kristian-94/moodle...
Get the full course on Udemy: www.udemy.com/course/moodle-d...
or skillshare: skl.sh/3deuyuv
To set up a local moodle environment, see: • Moodle setup tutorial ...
For custom development work, one on one training, or Moodle hosting, get in touch with us over at ringertech.org/contact
Thank you boss. Awesome work
Thank you so much for this tutorial, I will watch all of your tutorial about form api ^_^
Thank you for this tutorial, may I ask what IDE you are using, and how do your search from the codebase, what key strokes you pressed here at 9:18?
Check out my set up videos, specifically this one: ruclips.net/video/dArD8qeqTRk/видео.html
I use PHPstorm, and there I did ctrl + shift + f
phpstorm does a nice job of indexing the codebase and doing fast searches. good luck!
@@moodletips Thank you very much
I don't know why, but 'class edit extends moodleform' didn't work, it said `Exception - Class "local_message\form\moodleform" not found`. but `class edit extends \moodleform` seemed to be fine
Looks like you just had to import it at the top, so you don't need the full path
If I use plugin for moodle
And I want to make script to use it automatically
When I change domain or environment moodle
Without reinstalling all plugin again??????
What do you mean use it automatically? Most plugins by default are not enabled but can be enabled in the config. If you want to set up a new env with the same config, you could try doing a full database backup and restore, or running sql directly on the mdl_config table to change the settings to enable and set up the plugin without going through the ui
How can i add css to the mustache file? moodle documentation it's not concrete
You don't add css directly to a mustache file. You could add it in the theme, or in the plugin in a styles.css file in the root of the plugin. In the theme tutorial we put css in the theme
hi, I love watching your tutorials. But I have some concern and maybe you can help me with this?
when i ran the upgrade.php, i don't think it proceeded it showed
[System] this test must pass - PHP setting max_input_vars must be atleast 5000.
I tried adjusting the max_input_vars and still getting that response when I ran the upgrade.
Thank you!
Thanks for watching :) Yes that is a new requirement for the new Moodle versions. If you want to run that you'll need to change this php setting. You'll need to make sure you've changed it for the web server/apache php.ini file and restart the server. If you look at phpinfo() you should see your new config there, that's what moodle will look at
thank you! @@moodletips
For some reason, my previous post no longer shows up, so I am reposting. First, thank you for the tutorial. It was great. However, the link attached to "You can get the code here" is invalid. Is it possible for you to replace it with a valid URL? Thanks.
Thanks for catching that, have fixed the link now
I know I am two years late but if you respond, can I have the add blocks feature within the manage page
Are you talking about adding blocks to these custom pages that we build? For that look up creating a new block region in your plugin templates
@@moodletips yes. Okay, will do. Thanks for the speedy response. You are still awesome!
@@moodletips the reason why I asked also because following your tutorial the pages don't have an "add a block" option
require_once(__DIR__ . '/../../local/message/classes/form/edit.php'); I given like this but I would like to know $CFG