2017 © Pedro Peláez
 

library php-x-editable

Maybe the best x-editable plugin for PHP

image

diana/php-x-editable

Maybe the best x-editable plugin for PHP

  • Saturday, November 18, 2017
  • by xiaohuilam
  • Repository
  • 2 Watchers
  • 14 Stars
  • 29 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

php-x-editable

Maybe the best X-Editable PHP plugin of the world. 如果你是中文用户,也许看中文文档能更快上手。, (*1)


travis-ci.svg packagist-version.svg license.svg download-count.svg open-issue.png open-pull-request.png last-commit.png contributors.png, (*2)

Install

 $ composer require diana/php-x-editable -vvv

After installed, javascript and css is using jsdelivr. But if, your project is local web using, or orther limitation to hosted assets locally, please run the command bellow:, (*3)

 $ composer require diana/php-x-editable-assets -vvv
 $ composer run-script post-autoload-dump -d vendor/diana/php-x-editable-assets

The secondary line, is publishing css/js to web directory of your project. it will detect laravel(lumen) and thinkphp5 framework, to publish to public/ directory. ortherwise, defaultly, it will deploy css/js to web root dir itself., (*4)

If indeed, please run, (*5)

 $ cp -R ./vendor/diana/php-x-editable-assets/assets/ SPECIFIC_PROJECT_FULLPATH/

Usage

<?php
$editable = new \Editable\Editable(
    [
        'id'            => 12,
        'name'          => '张君宝',
        'home'          => '武当山',
        'prefer'        => 'php,html',
        'gender'        => 1,
        'job'           => 2,
        'about'         => 'Throne of the seven kingdoms,<br/> <i>Father of the dragon</i>, <b>stormborn</b>, <u>unburn</u>.',
        'created_at'    => date('Y-m-d H:i:s'),
    ], 
    'id', 
    [], 
    'test.php?action=save'
);

$editable->typeahead('home', null, [
    '武当山',
    '华山',
    '峨眉山',
    '井冈山',
], 0);

$editable->checklist('job', null, [
    ['value' => 1, 'text' => '一代弱鸡'],
    ['value' => 2, 'text' => '一代宗师'],
    ['value' => 3, 'text' => '一代刺客']
], 0);

$editable->select('gender', null, [
    ['value' => 0, 'text' => '未知'],
    ['value' => 1, 'text' => '男'],
    ['value' => 2, 'text' => '女'],
], 0);

$editable->tag('prefer', null, ['css', 'js', 'google']);

$editable->wysiwyg('about');
$editable->datetime('created_at');
echo $editable->render()->getBody();

To get full demo here: https://github.com/xiaohuilam/php-x-editable/blob/dev/example/Editable.php, (*6)

Input[Text]

1.png, (*7)

Typeahead

2.png, (*8)

Tag

3.png, (*9)

Checklist

5.png, (*10)

Select

4.png, (*11)

Wysiwyg(所见即所得)

6.png, (*12)

Datetime(日期时间)

7.png, (*13)

Features and TODO

Feature Description Status
text Finished
select Finished
tags Finished
datetime Finished
wysiwyg Finished
assets self host To see in the introduce Finished
Auto save re-use your data reading code, avoid code again. Awaiting
Multiple rows multiple rows data editing Awaiting
Async source select/typeahead's ajax remote source support Partly(supportted with select box currently)
File upload x-editable is not support file uploading natively, until us Awaiting
Post extra param other params like csrf_token Awaiting

Credits & thanks

  • x-editable: https://github.com/vitalets/x-editable
  • bootstrap: https://github.com/twbs/bootstrap/releases/tag/v3.3.7
  • php-html-builder: https://github.com/avplab/php-html-builder

License

MIT

Donation

There's no donation accepted. But you can support me when you shopping checkout with Alipay wallet APP. Before checkout, scan the QR code, you can get a small amount disacount, and me, will receive a bonus. zfb.jpg, (*14)

The Versions

18/11 2017

dev-master

9999999-dev

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

18/11 2017

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

18/11 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

17/11 2017

dev-dev

dev-dev

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

17/11 2017

v0.06

0.06.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

13/11 2017

v0.05

0.05.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

12/11 2017

v0.04

0.04.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by xiaohui lam

09/11 2017

v0.03

0.03.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

by xiaohui lam

09/11 2017

v0.02

0.02.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

by xiaohui lam

08/11 2017

v0.01

0.01.0.0

Maybe the best x-editable plugin for PHP

  Sources   Download

MIT

The Requires

 

by xiaohui lam