adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

call_user_func_array() error #31

Closed ct14it closed 10 years ago

ct14it commented 10 years ago

System info

Elementary OS 32bit (Ubuntu effectively I think!) PHP 5.5.9

Installation info

Following the instructions listed here : https://github.com/adamwathan/bootforms

composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "4.2.*",
        "adamwathan/bootforms": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "dev"
}

Installed by running composer update

Testing

I use php artisan serve to test, so I am running on localhost:8000

Error

ErrorException (E_UNKNOWN)

call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object

in file

/home/ct14/Laravel/site3/vendor/adamwathan/bootforms/src/AdamWathan/BootForms/BootForm.php

Thanks for your time!

ct14it commented 10 years ago

To respond to your message from twitter

Actually looking now I'm guessing the problem is you haven't started the form with BootForm::open()?

Hah! That would be it! Me changing

Route::get('/dog', function()
{
    return BootForm::text("Email","email");
});

to

Route::get('/dog', function()
{
    return BootForm::open().BootForm::text("Email","email").BootForm::close();
});

fixed it!

adamwathan commented 10 years ago

Glad it's fixed and thanks for the detailed issue report :)