2017 © Pedro Peláez
 

library htmlext

image

mobytes/htmlext

  • Monday, July 4, 2016
  • by evervasquez
  • Repository
  • 5 Watchers
  • 0 Stars
  • 31 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel 4.2 table builder

Table builder for Laravel 4.2, (*1)

Installation

``` json { "require": { "mobytes/htmlext": "dev-master" } }, (*2)


run `composer update` Then add Service provider to `config/app.php` ``` php 'providers' => [ // ... 'Mobytes\Htmlext\HtmlextServiceProvider' ]

And Facade (also in config/app.php), (*3)

``` php 'aliases' => [ // ... 'TableBuilder' => 'Mobytes\Htmlext\Facade\TableBuilder', ], (*4)


### Quick start Create a class with the table settings ```php <?php namespace App\Tables; use Mobytes\Htmlext\Table; class NoticeTable extends Table { //create text button protected $btn_new = "Crear nueva noticia"; //Table title protected $title = "Todas las noticias de cepco.org.pe"; //activate the paginate protected $paginate = true; //number of records per page protected $per_page = 7; //Titles of thead protected $thead = array( "title" => [ "Titulo", "Subtitulo", "Contenido", "Tags", "Actions" ] ); //records tbody protected $tbody = array( "fields" => [ "titulo" => [ "class" => "" ], "subtitulo" => [ "class" => "" ], "contenido" => [ "class" => "" ], "tags" => [ "class" => "" ] ] ); //Start function public function build() { $prefix_router = "landpage.noticias"; $this->build($prefix_router); } }

After that instantiate the class in the controller and pass it to view:, (*5)

<?php namespace App/Http/Controllers;

use Illuminate\Routing\Controller as BaseController;
use Mobytes\Htmlext\TableBuilderTrait;

class NoticesController extends BaseController {

    // ...
    use TableBuilderTrait;

    public function index()
    {
        //notices type Builder
        $notices = $this->publication->getAllByType(self::$_NOTICE);

        $table = $this->table('Mobytes\Landpage\Publication\Table\NoticeTable',$notices);

        return View::make(Config::get('notices.index'), compact('table'));
    }
}

Print the form in view with table() helper function:, (*6)



@extend('layouts.master')

@section('content')
    {{ table($table) }}
@endsection

The Versions

04/07 2016

dev-cepco

dev-cepco

  Sources   Download

The Requires

 

by Mobytes S.A.C

08/12 2015

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Mobytes S.A.C

06/09 2015

v0.91

0.91.0.0

  Sources   Download

The Requires

 

by Mobytes S.A.C

06/09 2015

v0.9

0.9.0.0

  Sources   Download

The Requires

 

by Mobytes S.A.C