Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-44117

Add html_writer:hidden_input and html_writer::hidden_inputs

    XMLWordPrintable

Details

    • Improvement
    • Status: Development in progress
    • Minor
    • Resolution: Unresolved
    • 2.6
    • FRONTEND
    • HTML and CSS

    Description

      Adding a hidden input to a form is a fairly routine thing to do, as is adding a bunch of them based on an array. This change add functions to do both to html_writer.

      before:

      $html .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'targetid', 'value'=>$currentcourse));
      

      after:

      $html .= html_writer::hidden_input('targetid', $currentcourse);
      

      before:

      foreach ($nextstageurl->params() as $key=>$value) {
          $form .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>$key, 'value'=>$value));
      }
      

      after:

      $form .= html_writer::hidden_inputs($nextstageurl->params());
      

      Attachments

        Issue Links

          Activity

            People

              bawjaws David Scotson
              bawjaws David Scotson
              Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: