Download the PHP package uestla/twigrid without Composer

On this page you can find all versions of the php package uestla/twigrid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twigrid

TwiGrid

... is a DataGrid for Nette Framework.

Buy me a Coffee

Demo: https://kesspess.cz/twigrid/
Demo sources: https://github.com/uestla/twigrid-demo

It's based on another (and great) datagrid written by @hrach - https://github.com/nextras/datagrid. My datagrid is hugely inspired by this component and its programming ideas and therefore I would like to give this man a maximum credit and respect :-)

Quickstart

Let's see how many steps do we have to make to create our first datagrid.

  1. Create new project

  2. Install TwiGrid & client-side assets

    If you're not using yarn, you can install assets manually by looking into package.json and see required dependencies there.

    We'll then update app/Presenters/templates/@layout.latte to load downloaded assets:

  3. Database

    Download the SQLite3 file from the demo application and place it in app/Model/users.s3db.

    And we'll configure this database to be used by the application:

  4. Create datagrid

    Now it's finally time to create our first datagrid - let's create an app/Grids/UsersGrid.php file. We'll need database connection for data loading, so we inject it properly via constructor.

    We'll define the datagrid body inside the build() method. Although the table user has many columns, we'll have just some of them in our grid just to make it easy.

    TwiGrid also needs to know what column(s) it should consider as a primary key:

    And finally we'll tell TwiGrid how to load our users:

  5. To properly inject our grid into presenters, we'll need to create a factory interface:

    This interface will now be used for automatic factory generation, which is handy - we simply add this definition to config/common.neon:

  6. Having all of this done, we can now simply inject our grid factory into HomepagePresenter.

    Now we'll add the control factory itself:

  7. We're nearly done! Just open app/Presenters/templates/Homepage/default.latte, delete the whole content and replace it with

    That's all, folks!

    Now when you'll open the page, you might see something like this:

    Result screenshot

  8. Final improvement

    Maybe showing the country code isn't that sexy - we'd like to have the whole country name in "Country" column. To achieve that, we'll create custom grid template:

    And tell TwiGrid to use this template:

    Simple as that!

More

To see more examples, please visit the demo page. Enjoy!


All versions of twigrid with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.1.0
nette/http Version ^3.0
nette/forms Version ^3.0
nette/utils Version ^3.0 || ^4.0
latte/latte Version ^2.5 || ^3.0
nette/application Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package uestla/twigrid contains the following files

Loading the files please wait ....