Skip to content

Commit

Permalink
State that constant values can be used
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Apr 27, 2014
1 parent b85eb6b commit fb7e123
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ By default phone numbers are formatted in the `libphonenumber\PhoneNumberFormat:

#### PHP template

The `format()` method in the `phone_number_format` helper takes two arguments: a `libphonenumber\PhoneNumber` object and an optional `libphonenumber\PhoneNumberFormat` constant name.
The `format()` method in the `phone_number_format` helper takes two arguments: a `libphonenumber\PhoneNumber` object and an optional `libphonenumber\PhoneNumberFormat` constant name or value.

For example, to format `$myPhoneNumber` in the `libphonenumber\PhoneNumberFormat::NATIONAL` format:
For example, to format `$myPhoneNumber` in the `libphonenumber\PhoneNumberFormat::NATIONAL` format, either use:

<?php echo $view['phone_number_format']->format($myPhoneNumber, 'NATIONAL') ?>

or:

<?php echo $view['phone_number_format']->format($myPhoneNumber, \libphonenumber\PhoneNumberFormat::NATIONAL) ?>

By default phone numbers are formatted in the `libphonenumber\PhoneNumberFormat::INTERNATIONAL` format.

### Serializing `libphonenumber\PhoneNumber` objects
Expand Down

0 comments on commit fb7e123

Please sign in to comment.