PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, May 17, 2022

[FIXED] How to implement placeholder in a php file for moodle plugin?

 May 17, 2022     css, moodle, php     No comments   

Issue

Hello im new to moodle plugin development and I need to make the "Enter course schedule here..." in the third line disappear when I enter text. If im not mistake it is called placeholder but i dont know how to implement to.

Php code in my own moodle plugin


Solution

Try:

$mform->addElement('text', 'sched_code', 'Schedule Code', ['placeholder' => 'Enter course schedule here...']);

Although, you will want to use get_string() for both bits of text that are being output, rather than hard-coding them like that, so that they can be translated / customised as required.



Answered By - davosmith
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing