当前位置: 首页>>代码示例>>PHP>>正文


PHP Department::paginate方法代码示例

本文整理汇总了PHP中Department::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::paginate方法的具体用法?PHP Department::paginate怎么用?PHP Department::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Department的用法示例。


在下文中一共展示了Department::paginate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

<?php

Route::collection(array('before' => 'auth,csrf'), function () {
    Route::get(array('admin/departments', 'admin/departments/(:num)'), function ($page = 1) {
        $vars['messages'] = Notify::read();
        $vars['departments'] = Department::paginate($page, Config::get('meta.posts_per_page'));
        return View::create('departments/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
    });
    Route::get('admin/departments/edit/(:num)', function ($id) {
        $vars['messages'] = Notify::read();
        $vars['token'] = Csrf::token();
        $vars['department'] = Department::find($id);
        $vars['fields'] = Extend::fields('department', $id);
        return View::create('departments/edit', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
    });
    Route::post('admin/departments/edit/(:num)', function ($id) {
        $input = Input::get(array('title', 'slug', 'description'));
        $validator = new validator($input);
        $validator->check('title')->is_max(3, __('departments.title_missing'));
        if ($errors = $validator->errors()) {
            Input::flash();
            Notify::error($errors);
            return Response::redirect('admin/departments/edit/' . $id);
        }
        if (empty($input['slug'])) {
            $input['slug'] = $input['title'];
        }
        $input['slug'] = slug($input['slug']);
        department::update($id, $input);
        Extend::process('department', $id);
        Notify::successs(__('departments.update'));
开发者ID:pepfi,项目名称:anchor-cms,代码行数:31,代码来源:departments.php

示例2: url

@extends('layouts.admin.default')

@section('content')

<?php 
$departmentCount = Department::count();
$departments = Department::paginate(10);
$message = Session::get('message');
?>

<div class="page-container">

        <div class="row" style="padding-bottom:20px;">

          <div class="col-md-2 clearfix">

            <aside class="sidebar">
              <nav class="sidebar-nav">
                <ul id="menu">
                  <li>
                    <a href="{{ url('/admin/dashboard') }}">
                      <span class="sidebar-nav-item-icon fa fa-tachometer fa-lg"></span>                      
                      <span class="sidebar-nav-item">Dashboard</span>                      
                    </a>
                    
                  </li>
                  <li>
                    <a href="#">
                      <span class="sidebar-nav-item-icon fa fa-users fa-lg"></span>                      
                      <span class="sidebar-nav-item">Employees</span>                      
                    </a>
开发者ID:jarciga,项目名称:Euler2015Alpha,代码行数:31,代码来源:departmentnew.blade.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $department = \Department::paginate(20);
     return \View::make('admin/department.manage')->with('depart', $department);
 }
开发者ID:bhoopal10,项目名称:PayrollOriginal,代码行数:10,代码来源:DepartmentController.php


注:本文中的Department::paginate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。