View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFPROP:Proposal Zone Template}

{zone-data:component-name}
Zend_Filter_StringToCapitalize
{zone-data}

{zone-data:proposer-list}
[~thomas]
{zone-data}

{zone-data:liaison}
TBD
{zone-data}

{zone-data:revision}
1.0 - 12 April 2010: Initial Draft.
{zone-data}

{zone-data:overview}
Zend_Filter_StringToCapitalize is a simple string filter which lowercases the string and capitalizes each word.
{zone-data}

{zone-data:references}
* [ucfirst|http://php.net/ucfirst]
* [mb_case_convert|http://php.net/mb_case_convert]
{zone-data}

{zone-data:requirements}
* This component *will* capitalize strings by lowercasing them and uppercasing the first character of each word
* This component *will* only work on strings
{zone-data}

{zone-data:dependencies}
* Zend_Filter
{zone-data}

{zone-data:operation}
The component is a string filter and can be used like all other filters.
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\] Proposal finished
* Milestone 2: Proposal accepted
* Milestone 3: Working implementation
* Milestone 4: Unit tests
* Milestone 5: Documentation
* Milestone 6: Moved to core
{zone-data}

{zone-data:class-list}
* Zend_Filter_StringToCapitalize
{zone-data}

{zone-data:use-cases}
||UC-01||
Default usage
{code}
$filter = new Zend_Filter_StringToCapitalize();
{code}
INPUT : "my input"
OUTPUT: "My Input"
||UC-02||
Encoding
{code}
$filter = new Zend_Filter_StringToCapitalize(array('encoding' => 'UTF-8'));
{code}
INPUT : "my ärger"
OUTPUT: "My Ärger"
||UC-03||
Only first word
{code}
$filter = new Zend_Filter_StringToCapitalize(array('case' => 'first'));
{code}
INPUT : "my ärger"
OUTPUT: "My ärger"
{zone-data}

{zone-data:skeletons}
{code}
class Zend_Filter_StringToCapitalize {
public function getEncoding();
public function setEncoding($encoding);
public function getCase();
public function setCase($case);
public function filter($value);
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>