本文整理匯總了PHP中Illuminate\Support\Fluent::address方法的典型用法代碼示例。如果您正苦於以下問題:PHP Fluent::address方法的具體用法?PHP Fluent::address怎麽用?PHP Fluent::address使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Support\Fluent
的用法示例。
在下文中一共展示了Fluent::address方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Collection
$person = ['name' => ['first' => 'Jill', 'last' => 'Schmoe']];
echo 'name.first is ' . array_get($person, 'name.first') . "\n";
$messageBag->add('notice', 'Array dot notation displayed.');
echo '<hr>';
// Collection
$people = new Collection(['Declan', 'Abner', 'Mitzi']);
$people->each(function ($person) {
echo "Collection person: {$person}\n";
});
$messageBag->add('notice', 'Collection displayed.');
echo '<hr>';
// More at http://daylerees.com/codebright/eloquent-collections
// Fluent
$personRecord = array('first_name' => 'Mohammad', 'last_name' => 'Gufran');
$record = new Fluent($personRecord);
$record->address('hometown, street, house');
echo $record->first_name . "\n";
echo $record->address . "\n";
$messageBag->add('notice', 'Fluent displayed.');
echo '<hr>';
// Pluralizer
$item = 'goose';
echo "One {$item}, two " . Pluralizer::plural($item) . "\n";
$item = 'moose';
echo "One {$item}, two " . Pluralizer::plural($item) . "\n";
echo '<hr>';
// Str
if (Str::contains('This is my fourteenth visit', 'first')) {
echo 'Howdy!';
} else {
echo 'Nice to see you again.';