URL version of a string

Author Message

Damien MARTIN

Tuesday 09 March 2010 2:40:17 am

Hi there,

I was looking for a way to get the URL version of a string in PHP, but I don't found anything in the API.

What I'm looking for is :

  • Convert : "My string qu'elle est belle from Paris"
  • In : "My-string-qu-elle-est-belle-from-paris"

It is exactly what eZ does when you create a new content.

Thanks in advance,

Damien

Damien MARTIN

Tuesday 09 March 2010 2:56:23 am

I just found the answer to my question with this post : http://share.ez.no/forums/developer/multilingual-japanese-url-alias

So, the method is :

eZURLAliasML::convertToAlias($my_string);

Hope this will help :)

Damien

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:57:39
Script start
Timing: Jan 18 2025 02:57:39
Module start 'layout'
Timing: Jan 18 2025 02:57:39
Module start 'content'
Timing: Jan 18 2025 02:57:40
Module end 'content'
Timing: Jan 18 2025 02:57:40
Script end

Main resources:

Total runtime0.6664 sec
Peak memory usage4,096.0000 KB
Database Queries53

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9063152.6250
Module start 'layout' 0.00460.0027 740.531339.4453
Module start 'content' 0.00730.6579 779.9766461.9609
Module end 'content' 0.66520.0011 1,241.93758.1719
Script end 0.6664  1,250.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4363160.0002
Check MTime0.00120.1854160.0001
Mysql Total
Database connection0.00050.078410.0005
Mysqli_queries0.624393.6843530.0118
Looping result0.00050.0764510.0000
Template Total0.641696.320.3208
Template load0.00170.261920.0009
Template processing0.639896.009720.3199
Template load and register function0.00010.014710.0001
states
state_id_array0.00090.139210.0009
state_identifier_array0.00080.118920.0004
Override
Cache load0.00140.2136210.0001
Sytem overhead
Fetch class attribute can translate value0.00050.070110.0005
Fetch class attribute name0.00120.187330.0004
XML
Image XML parsing0.00170.252610.0017
class_abstraction
Instantiating content class attribute0.00000.001240.0000
General
dbfile0.00200.2954160.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs