PHP code example of d3mo17 / colja

1. Go to this page and download the library: Download d3mo17/colja library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

d3mo17 / colja example snippets




return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // ...
    DMo\Colja\DMoColjaBundle::class => ['all' => true],
];




namespace App\GraphQL;

use DMo\Colja\GraphQL\AbstractResolver;

class DemoResolver extends AbstractResolver
{
    public function demo(array $root = null, array $args): string
    {
        return "Hello World!";
    }

    public function demoWithArguments(array $root = null, array $args): string
    {
        $num = array_key_exists('num', $args) ? $args['num'] : 17;
        return "Hello ${args['name']}. The magic number is $num!";
    }
}

a-symfony-project/
├─ bin/
├─ config/
│  ├─ graphql/
│  │  ├─ base.schema
│  ├─ packages/
│  │  ├─ .../
│  │  ├─ d_mo_colja.yaml
│  │  ├─ ...
|  ├─ bundles.php
│  ├─ .../
├─ src/
│  ├─ Controller/
│  ├─ .../
│  ├─ GraphQL/
│  │  ├─ DemoResolver.php
│  │  ├─ ...
├─ ...
├─ composer.json