URL encode?

Author Message

Jeroen de Jong

Wednesday 25 July 2007 4:51:51 am

Is there anyway to urlencode an url (using %20 to replace empty espace between words)?
Somthing like "str_replace" in PHP?

There are many string operators (like | chr, | ord, | crc32) that convert my string into many exotic formats....BUT NO URL encode?

please help

Ɓukasz Serwatka

Wednesday 25 July 2007 7:28:11 am

Hi,

Put in your template.ini.append.php:

[PHP]
PHPOperatorList[rawurldecode]=rawurldecode
PHPOperatorList[rawurlencode]=rawurlencode

Then you can use in templates input|rawurlencode or input|rawurldecode

Remember to clear the cache once you added those settings.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 19:36:25
Script start
Timing: Jan 18 2025 19:36:25
Module start 'layout'
Timing: Jan 18 2025 19:36:25
Module start 'content'
Timing: Jan 18 2025 19:36:26
Module end 'content'
Timing: Jan 18 2025 19:36:26
Script end

Main resources:

Total runtime0.9285 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 592.0781152.6094
Module start 'layout' 0.00540.0036 744.687539.3984
Module start 'content' 0.00900.9182 784.0859524.9609
Module end 'content' 0.92730.0012 1,309.04698.2031
Script end 0.9285  1,317.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.4593160.0003
Check MTime0.00160.1690160.0001
Mysql Total
Database connection0.00080.083510.0008
Mysqli_queries0.884495.2500540.0164
Looping result0.00050.0563520.0000
Template Total0.897296.620.4486
Template load0.00310.330020.0015
Template processing0.894196.290320.4470
Template load and register function0.00010.016010.0001
states
state_id_array0.00070.071410.0007
state_identifier_array0.00100.109120.0005
Override
Cache load0.00260.2820140.0002
Sytem overhead
Fetch class attribute can translate value0.00060.064320.0003
Fetch class attribute name0.00090.099430.0003
XML
Image XML parsing0.00060.062520.0003
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00080.0819180.0000
String conversion0.00000.001240.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 10
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs