Back to Microdata class

Method __construct

public
__construct
(mixed $type = '', mixed $flag = true)
Initialize the class and setup the default $Type
Parameters
  • string $type Optional, fallback to 'Thing' Type
  • bool $flag Enable or disable the library output
Since
  • 3.2
Class: Microdata
Project: Joomla

Method __construct - Source code

/**
 * Initialize the class and setup the default $Type
 *
 * @param   string   $type  Optional, fallback to 'Thing' Type
 * @param   boolean  $flag  Enable or disable the library output
 *
 * @since   3.2
 */
public function __construct($type = '', $flag = true)
{
    if ($this->enabled = (bool) $flag) {
        // Fallback to 'Thing' Type
        if (!$type) {
            $type = 'Thing';
        }
        $this->setType($type);
    }
}