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

Add html_writer::image() to lib/outputcomponents.php

    XMLWordPrintable

Details

    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_27_STABLE
    • MOODLE_27_STABLE
    • Hide

      use it by calling the function as shown:
      html_writer::img('foo.com','Foo',array('title'=>'Foo2'));
      This will result in the following string:
      <img src="foo.com" alt="Foo" title="Foo2"/>

      Show
      use it by calling the function as shown: html_writer::img('foo.com','Foo',array('title'=>'Foo2')); This will result in the following string: <img src="foo.com" alt="Foo" title="Foo2"/>

    Description

      Further to the discussion here: https://moodle.org/mod/forum/discuss.php?d=168040#p737385

      It should be relatively simple to add a helper function specifically for images which would be a bit less verbose than using html_writer::empty_tag().

      Attachments

        Issue Links

          Activity

            People

              apsdehal Amanpreet Singh
              markdw Mark Ward
              Andrew Lyons Andrew Lyons
              Damyon Wiese Damyon Wiese
              Ankit Agarwal Ankit Agarwal
              Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/May/14