mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
Made a start on improved layout
This commit is contained in:
@@ -1,41 +1,43 @@
|
||||
capitalize {#language.modifier.capitalize}
|
||||
==========
|
||||
# capitalize (modifier)
|
||||
|
||||
This is used to capitalize the first letter of all words in a variable.
|
||||
This is similar to the PHP [`ucwords()`](&url.php-manual;ucwords)
|
||||
function.
|
||||
|
||||
Parameter Position Type Required Default Description
|
||||
-------------------- --------- ---------- --------- -----------------------------------------------------------------------------------------------------------
|
||||
1 boolean No FALSE This determines whether or not words with digits will be uppercased
|
||||
2 boolean No FALSE This determines whether or not Capital letters within words should be lowercased, e.g. \"aAa\" to \"Aaa\"
|
||||
## Parameters
|
||||
|
||||
| Position | Type | Required | Default | Description |
|
||||
|----------|---------|----------|---------|-------------------------------------------------------------------------------------------------------|
|
||||
| 1 | boolean | No | False | This determines whether or not words with digits will be uppercased. |
|
||||
| 2 | boolean | No | False | This determines whether or not Capital letters within words should be lowercased, e.g. "aAa" to "Aaa" |
|
||||
|
||||
<?php
|
||||
## Example
|
||||
|
||||
$smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
|
||||
|
||||
?>
|
||||
PHP-script:
|
||||
|
||||
```php
|
||||
$smarty->assign('articleTitle', 'next x-men film, x3, delayed.');
|
||||
```
|
||||
|
||||
|
||||
Where the template is:
|
||||
|
||||
|
||||
```smarty
|
||||
{$articleTitle}
|
||||
{$articleTitle|capitalize}
|
||||
{$articleTitle|capitalize:true}
|
||||
|
||||
```
|
||||
|
||||
|
||||
Will output:
|
||||
|
||||
|
||||
```
|
||||
next x-men film, x3, delayed.
|
||||
Next X-Men Film, x3, Delayed.
|
||||
Next X-Men Film, X3, Delayed.
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
|
||||
See also [`lower`](#language.modifier.lower) and
|
||||
[`upper`](#language.modifier.upper)
|
||||
- [lower (modifier)](./language-modifier-lower.md)
|
||||
- [upper (modifier)](./language-modifier-upper.md)
|
||||
|
@@ -1,31 +1,26 @@
|
||||
cat {#language.modifier.cat}
|
||||
===
|
||||
# cat (modifier)
|
||||
|
||||
This value is concatenated to the given variable.
|
||||
|
||||
Parameter Position Type Required Default Description
|
||||
-------------------- -------- ---------- --------- -----------------------------------------------
|
||||
1 string No *empty* This value to catenate to the given variable.
|
||||
## Parameters
|
||||
|
||||
| Position | Type | Required | Default | Description |
|
||||
|----------|--------|----------|---------|-----------------------------------------------|
|
||||
| 1 | string | No | *empty* | This value to catenate to the given variable. |
|
||||
|
||||
<?php
|
||||
|
||||
$smarty->assign('articleTitle', "Psychics predict world didn't end");
|
||||
|
||||
?>
|
||||
|
||||
## Example
|
||||
|
||||
PHP-script:
|
||||
```php
|
||||
$smarty->assign('articleTitle', "Psychics predict world didn't end");
|
||||
```
|
||||
|
||||
Where template is:
|
||||
|
||||
|
||||
```smarty
|
||||
{$articleTitle|cat:' yesterday.'}
|
||||
|
||||
|
||||
```
|
||||
|
||||
Will output:
|
||||
|
||||
|
||||
```
|
||||
Psychics predict world didn't end yesterday.
|
||||
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user