Giter Site home page Giter Site logo

arkjo / autocompletersandbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from garak/autocompletersandbox

0.0 1.0 0.0 109 KB

A sandbox for PUGXAutoCompleterBundle

License: GNU Lesser General Public License v3.0

PHP 62.80% HTML 25.89% JavaScript 9.84% Shell 1.47%

autocompletersandbox's Introduction

PUGXAutoCompleter Sandbox

This is a demo project for PUGXAutoCompleterBundle.

It's basically a tipical Symfony project with some small additions.

It's using Select2 3.5.3 for JavaScript part. Not working with Select2 4.

Setup

  • clone this repository
  • run export HOST_UID=$UID
  • run docker-compose build
  • run docker-compose up -d
  • run docker exec -ti autocompletersandbox_php_1 bin/console faker:populate
  • you can login the container using docker exec -ti autocompletersandbox_php_1 bash
  • map in your hosts file autocompletersandbox.local on 127.0.0.1
  • you'll then be able to browser http://autocompletersandbox.local:8080

Testing

Run docker exec -ti autocompletersandbox_phpunit_1 bin/console faker:populate. Then you can test the application running docker exec -ti autocompletersandbox_phpunit_1 phpunit.

Be aware, since testing are really basic and based on some hard-coded values in database. If tests fail, try to drop database, re-create it and re-populate.

The Demo

This demo shows a list of books, and let you add a new book. When inserting a new book, you can autocomplete the author by name.

All the code should be self-explainatory, and it's kept to bare minimum for the purposes of this demo. The only exception is the "add new" feature (see next point).

Add new

Beside the main feature (that is, of course, autocomplete), this demo also shows how to implement an "add new" feature. With such feature, you can let users add new elements to the existing ones. If you don't need such feature, you can remove the relevant parts of JavaScript (see comments inside the code).

autocompletersandbox's People

Contributors

garak avatar

Watchers

James Cloos avatar

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.