Giter Site home page Giter Site logo

dudapiotr / zftable Goto Github PK

View Code? Open in Web Editor NEW
75.0 22.0 60.0 458 KB

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.

Home Page: http://dudapiotrek.laohost.net/

License: MIT License

PHP 69.19% CSS 1.30% JavaScript 7.30% HTML 20.38% TSQL 1.83%

zftable's Introduction

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads License

Repository is depracated and not supported.

Version 3.1 Created by Piotr Duda

Download

Complete site : dudapiotr.eu

Introduction

Awesome table/grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.

Contributors

If you want to help develop this module please don't hesitate. Thanks for cooperation:

Requirements

Features

  • Flexible generating table
  • Decoratoring headers, rows and cell
  • Conditional decorating (Greater, Lesser, Equal, NotEqual, Between)
  • Simply Integration with DataTables (last integrity 1.10)
  • Pagination, QuickSearch, Sorting and Items per page
  • Default Bootstrap layout - support for Bootstrap 3.0 and 2.2.2
  • Simple customization (show in example - we can change table view to any view eq list of articles with all features like pagination, quicksearch, sorint and item per page)
  • Editable decorator -> the ability to edit data from the table level
  • Filtering for each column
  • Row decorator for separating row by ordering column (dividing the same data)
  • Exporter data to CVS
  • Callable decorator
  • Doctrine 2 Adapter (Source)
  • Array Adapter (Source)
  • JavaScript Events (Callable Events)
  • Possibility to send additional params
  • Asset manager functionality (https://github.com/RWOverdijk/AssetManager)
  • Visio Crud Module integration (https://github.com/HyPhers/visio-crud-zf2/)

Changes in Version 3.1

Changes in Version 3.0

  • Callable decorator
  • Doctrine 2 Adapter (Source)
  • Array Adapter (Source)
  • JavaScript Events (Callable Events)
  • Possibility to send additional params

Changes in Version 2.0

  • Editable decorator -> the ability to edit data from the table level
  • Filtering for each column
  • Row decorator for separating row by ordering column (dividing the same data)
  • New conditions
  • Exporter data to CVS
  • Support for Bootstrap 3.0

In next versions

  • MongoDB adapter
  • Export only selected data
  • Add dynamically (by ajax) new row
  • More decorators and conditions
  • Adapter for JGrid
  • Exporter (PDFV)

Installation

Installation description has been moved to wiki https://github.com/dudapiotr/ZfTable/wiki/Installation-and-Configuration

Examples See on live

In Example directory there is a couple of examples how use decorators and generate table. After added js and css file to your layout view, in controller there are a table calls(based on data from ZF2 tutorial - album).

zftable's People

Contributors

alejandro-fiore avatar animir avatar dennisdobslaf avatar diegovarussa avatar drchav avatar dudapiotr avatar olekhy avatar seyfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zftable's Issues

Datatables 1.10 - How to Use:

Here some update n datables 1.10

object = $object; } else if ($object instanceof \Zend\Stdlib\ArrayObject) { $this->object = $object; } else { throw new Exception\InvalidArgumentException('parameter must be instance of ArrayObject'); } } /** * Init method */ public function init() { $array = $this->object->toArray(); $this->page = (isset($array['start'])) ? ($array['start'] / $array['length'] + 1) : self::DEFAULT_PAGE; if(isset($array['order'][0]['column'])){ $headers = $this->getTable()->getHeaders(); $slice = array_slice($headers, $array['order'][0]['column'], 1); $this->column = key($slice); } $this->order = (isset($array['order'][0]['dir'])) ? $array['order'][0]['dir'] : self::DEFAULT_ORDER; $this->itemCountPerPage = (isset($array['start'])) ? $array['length'] : 20; $this->quickSearch = (isset($array['search']['value'])) ? $array['search']['value'] : ''; } /** * Get page * @return int */ public function getPage() { return $this->page; } /** * Set page * @param string $page */ public function setPage($page) { $this->page = $page; return $this; } /** * Get order * @return string */ public function getOrder() { return $this->order; } /** * Set asc or desc ordering * @param order $order */ public function setOrder($order) { $this->order = $order; } /** * Get column * @return string */ public function getColumn() { return ($this->column == '') ? null : $this->column; } /** * * @param string $column * @return \ZfTable\Params\AdapterArrayObject */ public function setColumn($column) { $this->column = $column; return $this; } /** * Get item count per page * @return int */ public function getItemCountPerPage() { return $this->itemCountPerPage; } /** * * @param type $itemCountPerPage */ public function setItemCountPerPage($itemCountPerPage) { $this->itemCountPerPage = $itemCountPerPage; } /** * Return offset * @return int */ public function getOffset() { return ($this->getPage() * $this->getItemCountPerPage()) - $this->getItemCountPerPage(); } /** * Get quickserach string * @return string */ public function getQuickSearch() { return $this->quickSearch; } public function getPureValueOfFilter($key) { return $this->object[$key]; } ``` }

Security issue on ZFTable - SQL Injection

There is a sql injection on zftable for doctrine, I didn't tested the problem when zend table is used.

The problem originates in the usage of filters in ZfTable/src/ZfTable/Example/TableExample/Doctrine.php at $query->where("q.name like '%".$value."%' ");. There $value could be a malicious string which causes the sql injection.

To do the correct query it should be like in http://docs.doctrine-project.org/en/2.0.x/reference/query-builder.html using query builder of doctrine and creating the correct query expression for the where or using a parametrised query.

If I have some time I will try to fix the problem and make a pull request.

Warning: Ambiguous class resolution, "ZfTable\Decorator\Cell\ClassDecorator"

If you intall ZfTable with composer, it will come up with the following message:

Warning: Ambiguous class resolution, "ZfTable\Decorator\Cell\ClassDecorator" was found in both ".../vendor/dudapiotr/zftable/src/ZfTable/Decorator/Cell/ClassDecorator.php" and ".../vendor/dudapiotr/zftable/src/ZfTable/Decorator/Header/ClassDecorator.php", the first will be used.

This is because of a wrong namespace definition in /zftable/src/ZfTable/Decorator/Header/ClassDecorator.php
where it is namespace ZfTable\Decorator\Cell; instead of namespace ZfTable\Decorator\Header;

Layout Problem

Hi dudapiotr: I´m viewing the example and is like Application´s layout is "overwritten", because the table doesn´t have styles and pagination dont work
image
I think is something that I misunderstood, I followed the Readme steps

Regards

GMD

Inject translator on View renderer

Hello,
How can i add translator service on renderer object in order to be able to call translate helper on templates:

translate('TOTO');?>

I have this error when trying to do it directly:

Zend\View\HelperPluginManager::get was unable to fetch or create an instance for translate

Thanks !

How to use zfTable

I am a beginer in Zend and need a help. How to run examples in module and how to use it in other application. What is needed to do?
Could you post few sentences as a guide. Thanks

editable cell for doctrine orm

i received fatal error when i use editable row with doctrine orm

error;

Fatal error: Cannot use object of type Application\Entity\Accounts as array in /var/www/dev.kultureltv.com/vendor/dudapiotr/zftable/src/ZfTable/Decorator/Row/VarAttr.php on line 43

my zftable model;

namespace Application\DataTable;
use ZfTable\AbstractTable;
class Accounts extends AbstractTable
{
protected $config = array(
'showPagination' => true,
'showQuickSearch' => false,
'showItemPerPage' => true,
'showColumnFilters' => true,
'rowAction' => '/ajax/account/update',
);

protected $headers = array(
    'id' => array('title' => 'Id', 'width' => '50'),
    'fullName' => array('tableAlias' => 'q', 'title' => 'İsim', 'filters' => 'text', 'editable' => true),
    'username' => array('tableAlias' => 'q', 'title' => 'Giriş', 'filters' => 'text', 'editable' => true),
    'email' => array('tableAlias' => 'q', 'title' => 'E-posta', 'filters' => 'text'),
    'status' => array(
        'tableAlias' => 'q',
        'title' => 'Durum',
        'filters' => array(
            null => 'Tümü',
            'ACTIVE' => 'Aktif',
            'PASSIVE' => 'Pasif'
        ),
        'editable' => true),
    'dateOfCreation' => array('tableAlias' => 'q', 'title' => 'Kayıt Tarihi', 'filters' => 'text'),
    'edit' => array('title' => 'Güncelle'),
);

public function init()
{
    $this->getHeader('fullName')->getCell()->addDecorator('editable');
    $this->getRow()->addDecorator('varattr', array('name' => 'data-row' , 'value' => '%s' , 'vars' => array('id')));

    $this->getHeader('dateOfCreation')->getCell()->addDecorator('callable', array(
        'callable' => function ($context, $record) {
            return $record->getDateOfCreation()->format('d/m/Y H:i:s');
        }
    ));
}

protected function initFilters($query)
{
    if ($value = $this->getParamAdapter()->getValueOfFilter('fullName')) {
        $query->where("q.fullName like '%" . $value . "%' ");
    }
    if ($value = $this->getParamAdapter()->getValueOfFilter('username')) {
        $query->where("q.username like '%" . $value . "%' ");
    }
    if ($value = $this->getParamAdapter()->getValueOfFilter('email')) {
        $query->where("q.email like '%" . $value . "%' ");
    }
    if ($value = $this->getParamAdapter()->getValueOfFilter('status')) {
        $query->where("q.status like '%" . $value . "%' ");
    }
}

}

Table always list all results even with a where in source (Doctrine)

Here is my code:

$id = (int) $this->params()->fromRoute('id', 0);
$queryBuilder = $this->getEntityManager()->createQueryBuilder()
->add('select', 'q')
->add('from', $this->entityNamespace . ' q')
->leftJoin('q.customersInfos', 'b')
->leftJoin('b.customer', 'c')
->where('c.id = '.$id);

        $table = new ProductTable($this->getTranslator());
        $table
            ->setSource($queryBuilder)
            ->setParamAdapter($this->getRequest()->getPost());
        return $this->htmlResponse($table->render());

(a $query->getQuery()->getSQL() typed in phpmyadmin work as I want, but the table always show all my product table..)

Any ideas ??

Add callable render

I have no time to commit

But theres changes works :

<?php
//in ZfTable\Decorator\DecoratorPluginManager
class DecoratorPluginManager extends AbstractPluginManager
{
    protected $invokableClasses = array(
        /*...*/
        'cellcallable' => '\ZfTable\Decorator\Cell\CallableDecorator',
        /*...*/
    );
        /*...*/
}

And the new file :

<?php

namespace ZfTable\Decorator\Cell;

/**
 * Description of CallableDecorator
 *
 * @author Nicolas de Marqué <[email protected]>
 */
class CallableDecorator extends AbstractCellDecorator
{
    protected $callable;

    public function __construct(  callable $callable)
    {        
        $this->callable = $callable;        
    }

    public function render( $value )
    {
        $values = array();

        $actualRow = $this->getCell()->getActualRow();     

        return call_user_func_array($this->callable, array($value, $actualRow));

    }
}

The call is consequently :

<?php

        $this->getHeader( 'template' )->getCell()->addDecorator( 'callable', function($value, $values) {
            return $v . $values['anotherfield'] . "called";
        });

Thanks for your plugin very usefull :)

Zend Url Helper in callable

I am using the callable decorator like this:

    $this->getHeader('id')->getCell()->addDecorator('callable', array(
        'callable' => function($context, $record){
            return '<a href="/admin/edit/something/'.$record->getUuid().'">'.$record->getId().'</a>';
        }
    ));

Is it possible to use the view helper and routes here?

Typo issue in showExportToCSV examples

Since I have updated my version of Zend Framework to 2.3.4 I was getting the following error:

"The option "showExportToCSV " does not have a matching setter method which must be defined. "

To solve the problem simply remove the space after "CSV" in your table configuration.

The issue has been found in zftable/src/ZfTable/Example/TableExample and http://dudapiotr.eu/table/csv-export

Default columns order doesn't work

I try to implement default order to my columns but it doesn't seems to work.
I add this in headers' declaration:

protected $headers = array(
            'idservice' => array('title' => 'Nb') ,
            'name' => array('title' => 'Name', 'order' => 'desc'),
            'category' => array('title' => 'Category'),
            'description' => array('title' => 'Description'),
            'providers' => array('title' => 'Provider', 'sortable' => false, "width" => '250'),
            'price' => array('title' => 'Price'),
            'discount' => array('title' => 'Discount'),
            'thumb' => array('title' => '&nbsp;', 'sortable' => false),
            'delete' => array('title' => '&nbsp;', 'sortable' => false),
    );

I tried to replace 'desc' by 'asc', true or false with no success...

Columns are always order by ID, not by name.
Any idea to fix this issue ?

Conflict with the module SlmLocale

When using Zftable and SlmLocale (https://github.com/juriansluiman/SlmLocale) with the strategy "uripath", the table is displayed properly but it is not possible to use the filters. It looks like the Ajax request always return the whole table.

The module SlmLocale is used to detect the locale of a project. The UriPath strategy add the locale at the beginning of the URL. Ex: "myproject.com/page1" will become "myproject.com/en/page1". When I deactivate the UriPath strategy, Zftable is working properly.

Has anyone tried to work with both these modules at the same time?

automatic add of js vendors

Hi

why u dont modify the headscript of js to add your js files

and dont make the module users to copy the js files to their public

usage?

How do we use this mdoule?

What dio we need to extend? add data to?

What dio we need to place in the view script?

Kind regards

Error producing an iterator

I am using zf2 with doctrine2. Everything is working fine. But when I have an entity with two identifiers I get an "Error producing an iterator" exception. What am I doing wrong?

class User implements InputFilterAwareInterface
{
/* ... */

/**
 * @var integer
 *
 * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=true)
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="NONE")
 */
private $id;

/**
 * @var integer
 *
 * @ORM\Column(name="user_profile_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="NONE")
 */
private $userProfileId;

/* .. */

}

When I remove @Orm\Id from $userProfileId everything is working ok. But putting it back I get this "Error producing an iterator" exception.

Call initializable always by render

$this->initializable() is always called, because $this->isTableInit() is always false and would never set true. $tableInit is private and no method exist to change this variable.

My problem is, i can't change cell or rows outside my class. I want set the url in my controller and can't, because header exist till first i call render(). After i call the render() again in my view, all properties are overwrite, because $this->initializable() is again called.
e.g.:

//In my controller (or view)

$table = new CustomzfTable();
$table->getHeader('url')->getCell()->addDecorator('template', array('template'=>'<url href="'.$this->url()->fromRoute('user', array('id'=>'%s')).'" class="btn btn-default">User</a', 'vars' => array('id'))));

Did you mean here: AbstractTable.php

    /**
     * Init configuration like setting header, decorators, filters and others
     * (call in render method as well)
     */
    protected function initializable()
    {
        if(!$this->getParamAdapter()){
            throw new Exception\LogicException('Param Adapter is required');
        }
        if(!$this->getSource()){
            throw new Exception\LogicException('Source data is required');
        }

        $this->init = true;  //did you mean here $this->tableInit = true, $this->init doesn't exist

        if (count($this->headers)) {
            $this->setHeaders($this->headers);
        }
        $this->init();

        $this->initFilters($this->getSource()->getSource());
    }

I added a constructor, who create all $this->headers in my class. To avoid overwrite my created headerObject and check for exist header in addHeader().

Why you create the headerObject not till then you call render()?

Sorry for my bad English. :-)

Using RAW sql for zftable

Hi, first of all, great product you have made here.

I was wondering if it is possible in the model to use some raw sql. I have used your examples as a basis for my application, but i have a few complicated queries which would be better suited to some raw sql.

    public function fetchMethodName($id) { 

        $sql = new Sql($this->adapter);
        $select = $sql->select();

         $select->from('tableName')
                ->columns(array('*'))
                ;
            return $select;

        }  

Can this be converted into some raw sql

select * from tableName where xxx
create tableName if exists etc

About action buttons

Hi,

Let me know, is there a possibility to add action buttons or links (add, edit, delete, view ) for each row of the table.?

Thanks.

Total row

Hi,

One useful feature I was needing is to have a row at the bottom showing some sort of total per some columns.

Maybe this can be created with current features, I didnt tried yet to get into underground, just uding out of the box...

zftable

hello

how to use this module in zend studio zf2 . i have created empty local php project by default and want to use this zftable.

Template Decorator trying to access Doctrine entity as an array

Fatal error: Cannot use object of type Application\Entity\User as array in /www/vendor/dudapiotr/zftable/src/ZfTable/Decorator/Cell/Template.php on line 58

There two options that I can think of:

  1. Array Hydration for Doctrine entities
  2. modify the code to access the Doctrine entities as entities not as arrays

Temporary solution:

/**
 * Rendering decorator
 *
 * @param string $context
 * @return string
 */
public function render($context)
{
    $values = array();

    foreach ($this->vars as $var) {
        $actualRow = $this->getCell()->getActualRow();

        // if it's not an array try to use a getter method
        if (is_array($actualRow)){
            $values[] = $actualRow[$var];
        } else {
            $getter = 'get'.ucfirst($var);
            $values[] = $actualRow->$getter();
        }
    }

    $value = vsprintf($this->template, $values);

    if ($this->place == self::RESET_CONTEXT) {
        return $value;
    } else {
        return ($this->place == self::PRE_CONTEXT) ? $value . $context :  $context . $value;
    }
}

Doctrine 2

Do you maybe happen to know when the Doctrine 2 Adapter will be issued or at least how to pass collection of Entity objects to ZfTable. I see that it is using JSON and I'm having problem converting collection of objects to JSON.

SQL Join query

Hi,

Let us know how to work with sql join query for your table module?

When we put a query like this

    $sql = new Sql($this->adapter);
    $select = $sql->select();
    $select->from(array('i' => 'institution')) 
           ->join(array('u' => 'user'),   
            'i.user_id = u.id');

view page shows only the "loading image". At least it doesn't show an error. It just displays the table loading image.

Relationship between Institution table and User table is one to one.

Can you give some advises to us about this?

Thanks.

route like this is not working :http://zf2-tutorial.localhost/en-US/table/base

Hallo,
I have a question:
i use translation in my application and this is the route: http://zf2-tutorial.localhost/en-US/table/base
when i use this url i can see the zftable with customer data but i can not navigate.

but when i disable translation and use this url: "http://zf2-tutorial.localhost/en-US/table/base"
then it work properly.

what can i do to use translation with this route (http://zf2-tutorial.localhost/en-US/table/base) ?

Thank you

templateMap

Hi, I'm try to use my own templates. I write my config like this:

class DataTableCompanies extends AbstractTable
{
protected $config = array(
'valuesOfItemPerPage' => array(5, 10, 20, 50 , 100),
'templateMap' => array(
'paginator-slide' => '../../../view/templates/slide-paginator.phtml',
'default-params' => '../../../view/templates/default-params.phtml',
'container' => '../../../view/templates/container-b3.phtml',
'data-table-init' => '../../../view/templates/data-table-init.phtml',
'custom-b2' => '../../../view/templates/custom-b2.phtml',
'custom-b3' => '../../../view/templates/custom-b3.phtml',
)
);

I can't use DIR in this array and I get an error:
Warning: include(../../../view/templates/custom-b2.phtml) [function.include]: failed to open stream: No such file or directory in ....

How can I use templateMap option?¿

4.0 V - New Features

Please write here all your proposition to include in v4.
Next week I'd like to fix all problems from repository and add some new features. So If You have something in your mind please dont' hestitate.

Release Versioning

Could you please versioning your release according to this semantic?

MAJOR.MINOR.PATCH

MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.

for instance v3.1.0

Conflict with the module SlmLocale

When using Zftable and SlmLocale (https://github.com/juriansluiman/SlmLocale) with the strategy "uripath", the table is displayed properly but it is not possible to use the filters. It looks like the Ajax request always return the whole table.

The module SlmLocale is used to detect the locale of a project. The UriPath strategy add the locale at the beginning of the URL. Ex: "myproject.com/page1" will become "myproject.com/en/page1". When I deactivate the UriPath strategy, Zftable is working properly.

Has anyone tried to work with both these modules at the same time?

Date support

Is there support for converting timestamps from database to something like date('Y-m-d', $time); in zfTable? Also, how can I build a dropdown (e.g. for checking if, for example a value in the form is 0, then select an option from the dropdown, if is 1 select another, but the select has to be in every cell of the column of the table)? Thanks a lot!

keeps loading

Hi,

UPDATE:
so the problem was that jQuery.ajax callbacks where not being called.
Not sure exactly why but disabling the module ZfSnapPhpError fixed it

i have everything set up, the base example works.
Now i try to create a table with doctrine, all seems to be ok but the table keeps showing the loader.
I checked what events are called in javascript and it does the following:
onInit
beforeSend

so i checked the ajax call
headers:
Remote Address:127.0.0.1:80
Request URL:http://localhost/contact/client/ajaxTable
Request Method:POST
Status Code:200 OK
result:

<div class="zf-table-wrap  form-inline">
    <div class="table-header">
    </div>
    <div class="row ">
        <div class="col-sm-6 pull-left">
                            <header>
                    <h4>Doctrine 2</h4>
                </header>
                    </div>
            </div>
    <table  class="table table-bordered table-condensed table-hover table-striped dataTable"><thead><tr><td></td><td><input type="text" name="zff_name" class="filter&#x20;form-control" value=""></td></tr><tr class="zf-title"><th  data-order="asc" data-column="id" width="50" class="sorting sortable" >Id</th><th  data-order="asc" data-column="name" class="sorting sortable" >Name</th></tr></thead><tr  class="zf-data-row"><td  >1</td><td  >test </td></tr></table>    <div class="row">
        <div class="col-sm-6 text-left">
                            <label class="pull-left">
                    <select class="itemPerPage form-control">
                                                                                <option "">5</option>
                                                                                <option selected="selected">10</option>
                                                                                <option "">20</option>
                                                                                <option "">50</option>
                                                                                <option "">100</option>
                                            </select> 
                </label> 
                              </div>
        <div class="col-sm-6 text-right">
                            <div class="dataTables_paginate paging_bootstrap pagination">
                        <ul class="pagination">
        <li class="disabled">
            <a data-page="1" href="">&laquo;</a></li>
        <li class="disabled">
            <a data-page="" href="">&lsaquo;</a></li>

        <!-- Numbered page links -->
                    <li class="active">
                <a data-page="1" href="">
                    1                </a>
            </li>
                <!-- Next page link -->
        <li class="disabled">
            <a data-page="" href="">&rsaquo;</a></li>
        <!-- Last page link -->
        <li class="disabled">
            <a data-page="1" href="">&raquo;</a></li>
    </ul>
                </div>
                    </div>
        <div class="processing">
        </div>
    </div>
    <div class="params-wrap">
    <input type="hidden"  name="zfTablePage" value="1" />
    <input type="hidden"  name="zfTableColumn" value="" />
    <input type="hidden"  name="zfTableOrder" value="asc" />
    <input type="hidden"  name="zfTableQuickSearch" value="" />
    <input type="hidden"  name="zfTableItemPerPage" value="10" />
    </div>
</div>

am i missing something?

Thanks

Security issue on ZFTable - Input validation

In ZfTable/src/ZfTable/Controller/TableController.php input data from the user is not validated, that can cause XSS attacks and helps on the creation of sql injection attacks.

There should be and Input Filter to validate the data from the user. I know that the users of ZfTable should be the ones that validate the data, but I think that to avoid problems the example should have the Input Filter.

As well as the sql injection problem, if I have some time I will fix it.

Column filtering with a date picker

Hi,

First of all, thank you very much for your nice module. Let us know, how to add a date picker to table column filters.

For example : If table has a column like "Birthday", then how do we add a date picker to search filter of this birthday column ?

Thanks.

Doctrine entities with equal column names

When I have some entities that have columns of the same name and they have some relationship, I can't display the two columns at the same time using this module.

For example:

User entity, which has the an attribute named "name". Users have roles. Role has a name too.

If I want to show User.name and Role.name I can't, as an array index will overwrite the other

I don't know if you already did some to deal with this. I didn't find at the documentation

editable creates several requests on save

When using the editable feature there is an issue when saving.

Each time the pagination was used the number of post requests when using a save button increases by one.
The additional calls result in a 500 error because the post params are not correct.

Call to undefined method ArrayObject::toArray()

In ZfTable\Params\AdapterArrayObject you should change:

line 86: from:
$array = $this->object->toArray();
to:
$array = $this->object->getArrayCopy();

in order to fix:
PHP Fatal error: Call to undefined method ArrayObject::toArray() in /var/www/zf2-project/vendor/dudapiotr/zftable/src/ZfTable/Params/AdapterArrayObject.php on line 86, referer: /

Show total rows

Hi,

I think one useful feature is to display the total number of rows.

Link decorator not compatible with Doctrine

Hi,

The link decorator is not compatible with Doctrine.

The code should be updated to something similar with:

    public function render($context) {
        $values = array();
        if (count($this->vars)) {
            $actualRow = $this->getCell()->getActualRow();

            foreach ($this->vars as $var) {
                if (is_object($actualRow)) {
                    $method = 'get' . ucfirst($var);
                    $values[] = $actualRow->$method();
                } else {
                    $values[] = $actualRow[$var];
                }
            }
        }
        $url = vsprintf($this->url, $values);
        return sprintf('<a  href="%s">%s</a>', $url, $context);
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.