Back to Version class

Method setMediaVersion

public \Joomla\CMS\Version
setMediaVersion
(string $mediaVersion)
Sets the media version which is used to append to Joomla core media files.
Parameters
  • string $mediaVersion The media version.
Returns
  • \Joomla\CMS\Version Instance of $this to allow chaining.
Since
  • 3.2
Class: Version
Project: Joomla

Method setMediaVersion - Source code

/**
 * Sets the media version which is used to append to Joomla core media files.
 *
 * @param   string  $mediaVersion  The media version.
 *
 * @return  Version  Instance of $this to allow chaining.
 *
 * @since   3.2
 */
public function setMediaVersion(string $mediaVersion) : Version
{
    // Do not allow empty media versions
    if (!empty($mediaVersion)) {
        // Get the params ...
        $params = LibraryHelper::getParams('joomla');
        // ... set the media version ...
        $params->set('mediaversion', $mediaVersion);
        // ... and save the modified params
        LibraryHelper::saveParams('joomla', $params);
    }
    return $this;
}