API17

Difference between revisions of "JHtml::script"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 8: Line 8:
 
<nowiki>[</nowiki>[[Description:JHtml::script|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JHtml::script|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Since===
 
{{JVer|11.1 }}
 
===Synopsis===
 
 
<source lang="php">
 
<source lang="php">
public static JHtml::script ($file, $framework=false, $relative=false, $path_only=false, $detect_browser=true)
+
public static function script (
 +
        $file
 +
        $framework=false
 +
        $relative=false
 +
        $path_only=false
 +
        $detect_browser=true
 +
)
 
</source>
 
</source>
 
{| class="wikitable"
 
{| class="wikitable"
Line 44: Line 47:
 
|boolean
 
|boolean
 
|true
 
|true
|detect browser to include specific browser js files  
+
|detect browser to include specific browser js files
 
|-
 
|-
 
|}
 
|}
===Returns===
+
* '''Returns''' mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected
mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected
+
* '''Defined''' on line 483 of libraries/joomla/html/html.php
===Defined in===
+
* '''Since''' {{JVer|11.1 }}
libraries/joomla/html/html.php (line 479)
 
* see source code in [[jplatform:html/html.php#cl-479|BitBucket]]
 
===Referenced by===
 
 
===See also===
 
===See also===
 +
* {{JVer|11.1}} '''JHtml::script source code''' on [[jplatform:html/html.php#cl-475|BitBucket]]
 +
* {{JVer|11.1}} Class [[JHtml/11.1|JHtml]]
 +
* {{JVer|11.1}} Subpackage [[Subpackage_Html/11.1|Html]]
 +
* [[JHtml::script|Other versions of JHtml::script]]
 +
{{SeeAlso:JHtml::script}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JHtml::script|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JHtml::script|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
* [[JHtml/11.1|JHtml]]
+
===User contributed notes===
* [[JHtml::script|Other versions of this method]]
 
{{SeeAlso:JHtml::script}}
 
===Examples===
 
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 68: Line 70:
 
category=MethodExample
 
category=MethodExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:JHtml]][[Category:JHtml::script]]</noinclude>
 
<noinclude>[[Category:JHtml]][[Category:JHtml::script]]</noinclude>

Revision as of 21:04, 27 April 2011

The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Joomla 11.1 JHtml::script[edit]

Description[edit]

Write a <script></script> element.

Template:Description:JHtml::script [Edit Descripton]

public static function script (
        $file
        $framework=false
        $relative=false
        $path_only=false
        $detect_browser=true
)
Parameter Type Default Description
$file string path to file
$framework boolean false load the JS framework
$relative boolean false path to file is relative to /media folder
$path_only boolean false return the path to the file only
$detect_browser boolean true detect browser to include specific browser js files
  • Returns mixed nothing if $path_only is false, null, path or array of path if specific js browser files were detected
  • Defined on line 483 of libraries/joomla/html/html.php
  • Since Joomla 11.1

See also[edit]

Template:SeeAlso:JHtml::script [Edit See Also]

User contributed notes[edit]

<CodeExamplesForm />