Microweber\Providers\Template::foot PHP Method

foot() public method

public foot ( $script_src )
    public function foot($script_src)
    {
        if ($this->foot_callable == null) {
            $this->foot_callable = array();
        }
        if (is_string($script_src)) {
            if (!in_array($script_src, $this->foot)) {
                $this->foot[] = $script_src;
                return $this->foot;
            }
        } else {
            if (is_bool($script_src)) {
                $src = '';
                if (is_array($this->foot)) {
                    foreach ($this->foot as $footer) {
                        $ext = get_file_extension($footer);
                        switch (strtolower($ext)) {
                            case 'css':
                                $src .= '<link rel="stylesheet" href="' . $footer . '" type="text/css" media="all">' . "\n";
                                break;
                            case 'js':
                                $src .= '<script type="text/javascript" src="' . $footer . '"></script>' . "\n";
                                break;
                            default:
                                $src .= $footer . "\n";
                                break;
                        }
                    }
                }
                return $src;
            } elseif (is_callable($script_src)) {
                if (!in_array($script_src, $this->foot_callable)) {
                    $this->foot_callable[] = $script_src;
                    return $this->foot_callable;
                }
            }
        }
    }