本文整理汇总了PHP中App\Repositories\UserRepository::paginateInvitations方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::paginateInvitations方法的具体用法?PHP UserRepository::paginateInvitations怎么用?PHP UserRepository::paginateInvitations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类App\Repositories\UserRepository
的用法示例。
在下文中一共展示了UserRepository::paginateInvitations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* The functions to load invitations page
*
* @return string
*/
public function index()
{
try {
//Get the invitations for the currently logged in user
$invitations = $this->userRepo->paginateInvitations($this->auth->user());
//Get next Page url
$nextPageUrl = generate_next_page_url($invitations);
//This is not an ajax request
if (!$this->input->is_ajax_request()) {
//Load view with data
$this->load->view('pages/invitations', compact('invitations', 'nextPageUrl'));
} else {
//Is an ajax request
echo json_encode(['error' => false, 'grid' => $this->load->view('pages/partials/_invitations-grid', compact('invitations'), true), 'nextPageUrl' => $nextPageUrl]);
}
} catch (Exception $e) {
//Unexpected error
//This is not an ajax request
if (!$this->input->is_ajax_request()) {
//Show error page
show_404();
} else {
//Is an ajax request
echo json_encode(['error' => true, 'message' => $e->getMessage()]);
}
}
}