Revision history for UncamelAction
Revision [23237]
Last edited on 2016-05-20 07:38:47 by DennyShimkoski [Replaces old-style internal links with new pipe-split links.]Additions:
The following code is designed to be used with the [[OnPageLoadWithGlobalActions | OnPageLoadAction]]. Look there for examples.
Deletions:
Revision [19242]
Edited on 2008-01-28 00:14:44 by DennyShimkoski [Modified links pointing to docs server]No Differences
Additions:
$this->page['body'] = preg_replace_callback('|<a([^>]+)>(.*)</a>|smU', 'uncamel', $this->page['body']);
Deletions:
Additions:
$this->page['body'] = preg_replace_callback('|<a([^>] )>(.*)</a>|smU', 'uncamel', $this->page['body']);
Deletions:
Additions:
The following code is designed to be used with the [[OnPageLoadWithGlobalActions OnPageLoadAction]]. Look there for examples.
Save the following as actions/uncamel.php...
Save the following as actions/uncamel.php...
Deletions:
Revision [10533]
Edited on 2005-08-07 20:10:13 by DennyShimkoski [Hiding the "simpler" version for now (doesn't really work)]Additions:
=====Uncamel The Camels!=====
The following code is designed to be used with the [[OnPageLoadWithGlobalActions OnPageLoadAction]].
The following code is designed to be used with the [[OnPageLoadWithGlobalActions OnPageLoadAction]].
Deletions:
The following code is designed to be used with the [[OnPageLoadWithGlobalActions OnPageLoadAction]]. Just save the code below as "uncamel.php" in the actions directory and you're ready to go!
That version will only touch ""CamelCased"" links. If you'd like to convert all camel cased text, use the following version of uncamel.php instead...
$this->page['body'] = preg_replace('/([A-Z][^A-Z]*)/', '$1 ', $this->page['body']);
If you'd like to apply it across the site, create a page called ""GlobalActions"" and drop the following line of code in...
{{onpageload uncamel=""}}
Additions:
Keep everything ""CamelCased"" in the database, but Uncamel The Camels when the page is output.
%%(php)
That version will only touch ""CamelCased"" links. If you'd like to convert all camel cased text, use the following version of uncamel.php instead...
%%(php)
$this->page['body'] = preg_replace('/([A-Z][^A-Z]*)/', '$1 ', $this->page['body']);
%%(php)
That version will only touch ""CamelCased"" links. If you'd like to convert all camel cased text, use the following version of uncamel.php instead...
%%(php)
$this->page['body'] = preg_replace('/([A-Z][^A-Z]*)/', '$1 ', $this->page['body']);
Deletions:
Additions:
=====Uncamel The Horses!=====
Basically -- Keep everything ""CamelCased"" in the database, but Uncamel The Links when the page is output.
Basically -- Keep everything ""CamelCased"" in the database, but Uncamel The Links when the page is output.
Deletions:
Basically -- Keep everything ""CamelCased"" in the database, but Uncamel The Horses when the page is output.
Additions:
Basically -- Keep everything ""CamelCased"" in the database, but Uncamel The Horses when the page is output.
Additions:
The following code is designed to be used with the [[OnPageLoadWithGlobalActions OnPageLoadAction]]. Just save the code below as "uncamel.php" in the actions directory and you're ready to go!