Show gallery picture

morning, I want to show gallery album picture combined with jQuery and CakePHP.

  1. while I’m upload picture used plugin

    josegonzalez/cakephp-upload
    

    and follow step by step config in

    http://josediazgonzalez.com/2015/12/05/uploading-files-and-images/
    

    the result is success

  2. the next after success upload image, I want to show gallery picture, look beatiful use album jQuery gallery. After I have search via http://packagist.org I want used plugin and install them

    composer require hugodias/cakegallery dev-master
    

    the trouble on terminal cmd is shown below

    Installation failed, reverting ./composer.json to its original contents
    
    [RuntimeException]
    unable to get primary namespace for package hugodias/cakegallery.
    ensure you hava added proper 'autoload' section to your plugin's config as stated in README
    on https://github.com/cakephp/plugin-installer
    

    guide reference in https://github.com/cakephp/plugin-installer that doesn’t I’m understand

    For the installer to work properly ensure that your plugin’s composer config file has a proper autoload section. Assuming your plugin’s namespace is “MyPlugin” the autoload section would be like:

   "autoload": {
    "psr-4": {
        "MyPlugin\\": "src"
    }
}

Not strictly necessary for the working of the installer but ideally you would also have an “autoload-dev” section for loading test files:

"autoload": {
    "psr-4": {
        "MyPlugin\\": "src"
    }
},
"autoload-dev": {
    "psr-4": {
        "MyPlugin\\Test\\": "tests",
        "Cake\\Test\\" : "vendor/cakephp/cakephp/test"
    }
}

If your top level namespace is a vendor name then your namespace to path mapping would be like:

"autoload": {
    "psr-4": {
        "MyVendor\\MyPlugin\\": "src"
    }
},
"autoload-dev": {
    "psr-4": {
        "MyVendor\\MyPlugin\\Test\\": "tests",
        "Cake\\Test\\" : "vendor/cakephp/cakephp/test"
    }
}

here below my config in

composer.json

 "autoload": {
        "psr-4": {
            "App\\": "src/",
            "Nasa\\": "./plugins/Nasa/src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests/",
            "Cake\\Test\\": "vendor/cakephp/cakephp/tests/",
            "Nasa\\Test\\": "./plugins/Nasa/tests/"
        }
    },
  1. where the part of my composer.json that must to modified.
    thanx for help and any best ideas:pray:

I assume that you’re using Cake 3.x, because that’s what Jose’s plugin is for. The other plugin you’re trying to use is for Cake 2.x. There are major structural changes between the versions, so this will not work. There’s probably similar plugins you can find that will work with 3.x.

yes, I’m used CakePHP 3.7.4, I have used josegonzalez/cakphp-uppad for upload picture and success,
then I search another josegonzalez plugin to show picture gallery, or another plugin showing picture gallery which compatible CakePHP 3.x but not found, I’m tired

Seeing as showing a image gallery is a very site specific thing, there probably isn’t one and you’ll need to write something yourself.