API15

JApplication/stringURLSafe: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 47: Line 47:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=stringURLSafe
  category=stringURLSafe
  category=JApplication
  category=JApplication
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 00:17, 25 March 2017

Description

This method transliterates a string into an URL safe string or returns a URL safe UTF-8 string based on the global configuration


<! removed transcluded page call, red link never existed >

Syntax

static stringURLSafe($string)
Parameter Name Default Value Description
$string $input String to process

Returns

string Processed string

Defined in

libraries/joomla/application/application.php

Importing

jimport( 'joomla.application.application' );

Source Body

static public function stringURLSafe($string)
{
        $app = &JFactory::getApplication();
        if (self::getCfg('unicodeslugs') == 1)
        {
                $output = JFilterOutput::stringURLUnicodeSlug($string);
        } else {
                $output = JFilterOutput::stringURLSafe($string);
        }
        return $output;
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples