Download the PHP package petkopara/multi-search-bundle without Composer

On this page you can find all versions of the php package petkopara/multi-search-bundle. 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 multi-search-bundle

MultiSearchBundle

This bundle provides basic service and form type for Multi Search in Doctrine.

Build Status Scrutinizer Code Quality SensioLabsInsight Latest Stable Total Downloads

Description

Search in all of entity columns by given search term. In response returns Doctrine\ORM\QueryBuilder containing the multiple search criteria. The searched columns can be specified.

Installation

Using composer

composer require petkopara/multi-search-bundle

Add it to the AppKernel.php class:

new Petkopara\MultiSearchBundle\PetkoparaMultiSearchBundle(),

Usage

Service

You can directly use the service and to apply the multi search to any doctrine query builder.

public function indexAction(Request $request)
{
    $search = $request->get('search');
    $em = $this->getDoctrine()->getManager();

    $qb = $em->getRepository('AppBundle:Post')->createQueryBuilder('e');
    $qb = $this->get('petkopara_multi_search.builder')->searchEntity($qb, 'AppBundle:Post', $search);
   //$qb = $this->get('petkopara_multi_search.builder')->searchEntity($qb, 'AppBundle:Post', $search, array('name', 'content'), 'wildcard');

    ..
}

Form

Create your form type and include the multiSearchType in the buildForm function:

use Petkopara\MultiSearchBundle\Form\Type\MultiSearchType;

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
            ->add('search', MultiSearchType::class, array(
                'class' => 'AppBundle:Post', //required
                'search_fields' => array( //optional, if it's empty it will search in the all entity columns
                    'name',
                    'content'
                 ), 
                 'search_comparison_type' => 'wildcard' //optional, what type of comparison to applied ('wildcard','starts_with', 'ends_with', 'equals')

            ))
    ;
}

In the controller add call to the multi search service:

public function indexAction(Request $request)
{
    $search = $request->get('search');
    $em = $this->getDoctrine()->getManager();
    $queryBuilder = $em->getRepository('AppBundle:Post')->createQueryBuilder('e');
    $filterForm = $this->createForm('AppBundle\Form\PostFilterType');

    // Bind values from the request
    $filterForm->handleRequest($request);

    if ($filterForm->isValid()) {
        // Build the query from the given form object
        $queryBuilder = $this->get('petkopara_multi_search.builder')->searchForm($queryBuilder, $filterForm->get('search'));
    }

    ..
}

Render your form in the view

{{ form_rest(filterForm) }}

Available Options

The provided type has 2 options:

These parameters can be applyed to the service as well as 4th and 5th parameter to searchEntity() method

Author

Petko Petkov - [email protected]

License

MultiSearchBundle is licensed under the MIT License.


All versions of multi-search-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version ~2.8|~3.0
symfony/form Version ~2.8|~3.0
doctrine/doctrine-bundle Version ^1.6
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 petkopara/multi-search-bundle contains the following files

Loading the files please wait ....