|
|
Zend Framework 2 Documentation (Manual) | |
|
File: /_sources/modules/zend.filter.word.dash-to-separator.txt
Size: | 1083 |
Storage flags: | no_autoload,compress/gzip (41%) |
.. _zend.filter.set.dashtoseparator:
DashToSeparator
---------------
This filter modifies a given string such that 'words-with-dashes' are converted to 'words with dashes'.
.. _zend.filter.set.dashtoseparator.options:
Supported Options
^^^^^^^^^^^^^^^^^
The following options are supported for ``Zend\Filter\Word\DashToSeparator``:
- **separator**: A separator char. If this is not set the separator will be a space character.
.. _zend.filter.set.dashtoseparator.basic:
Basic Usage
^^^^^^^^^^^
A basic example of usage is below:
.. code-block:: php
:linenos:
$filter = new Zend\Filter\Word\DashToSeparator('+');
// or new Zend\Filter\Word\CamelCaseToSeparator(array('separator' => '+'));
print $filter->filter('this-is-my-content');
The above example returns 'this+is+my+content'.
.. _zend.filter.set.dashtoseparator.default-behavior:
Default Behavior
^^^^^^^^^^^^^^^^
.. code-block:: php
:linenos:
$filter = new Zend\Filter\Word\DashToSeparator();
print $filter->filter('this-is-my-content');
The above example returns 'this is my content'.
For more information about the PHK package format: http://phk.tekwire.net