Package Home

Zend Framework 2 Documentation (Manual)

PHK Home

File: /_sources/modules/zend.filter.word.camel-case-to-separator.txt

Size:1118
Storage flags:no_autoload,compress/gzip (39%)

.. _zend.filter.set.camelcasetoseparator:

CamelCaseToSeparator
--------------------

This filter modifies a given string such that 'CamelCaseWords' are converted to 'Camel Case Words'.

.. _zend.filter.set.camelcasetoseparator.options:

Supported Options
^^^^^^^^^^^^^^^^^

The following options are supported for ``Zend\Filter\Word\CamelCaseToSeparator``:

- **separator**: A separator char. If this is not set the separator will be a space character.

.. _zend.filter.set.camelcasetoseparator.basic:

Basic Usage
^^^^^^^^^^^

A basic example of usage is below:

.. code-block:: php
   :linenos:

   $filter = new Zend\Filter\Word\CamelCaseToSeparator(':');
   // or new Zend\Filter\Word\CamelCaseToSeparator(array('separator' => ':'));

   print $filter->filter('ThisIsMyContent');

The above example returns 'This:Is:My:Content'.

.. _zend.filter.set.camelcasetoseparator.default-behavior:

Default Behavior
^^^^^^^^^^^^^^^^

.. code-block:: php
   :linenos:

   $filter = new Zend\Filter\Word\CamelCaseToSeparator();

   print $filter->filter('ThisIsMyContent');

The above example returns 'This Is My Content'.


For more information about the PHK package format: http://phk.tekwire.net