本文整理汇总了PHP中UserInfo::all方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::all方法的具体用法?PHP UserInfo::all怎么用?PHP UserInfo::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveInfo
public function saveInfo()
{
$fname = Input::get('fname');
$lname = Input::get('lname');
$mname = Input::get('mname');
$address = Input::get('address');
$contact = Input::get('contact');
$email = Input::get('email');
$getInformation = new UserInfo();
$getInformation['firstname'] = $fname;
$getInformation['lastname'] = $lname;
$getInformation['middleInitial'] = $mname;
$getInformation['address'] = $address;
$getInformation['contactNo'] = $contact;
$getInformation['email'] = $email;
if ($getInformation->save()) {
$allReserves = UserInfo::all();
foreach ($allReserves as $allReserve) {
$response[] = array("reserve_id" => $allReserve['id'], "fname" => $allReserve['firstname'], "lname" => $allReserve['lastname'], "mname" => $allReserve['middleInitial'], "address" => $allReserve['address'], "contact" => $allReserve['contactNo'], "email" => $allReserve['email']);
}
}
return $response;
}
示例2:
<input type="checkbox" name="admin" id="admin" value="1">
</fieldset>
</div>
<!--<button type="button" id="saveInfo" class="btn btn-info">Save Information</button>-->
<button type="button" id="updateInfo"class="btn btn-warning">Update Information</button>
</form>
</div>
<div class="col-md-8">
<div class="list-group">
<a href="#" class="list-group-item active">
Guest Information
</a>
<div id="guest_list">
<?php
$allReserves = UserInfo::all();
?>
@foreach($allReserves as $allReserve)
<div class="input-group" id="reserve{{$allReserve['id']}}">
<a href="{{ URL::Route('getReserve',$allReserve['id']) }}" class="list-group-item">{{$allReserve['lastname']}},{{$allReserve['firstname']}}</a>
<span class="input-group-addon" data-type="edit" data-id="{{$allReserve['id']}}" style="cursor:pointer">Edit</span>
<!--<span class="input-group-addon" data-type="delete" data-id="{{$allReserve['id']}}" style="cursor:pointer">Delete</span>-->
</div>
@endforeach
<div>
</div>
</div>
</div>
</div>
</div>
</div>