Hi,
When I try to use <?= $this->basePath();?> in a template in mezzio, I get the ‘No base path provided’ error:
I am using laminas view, and this is a basic install of the mezzio skeleton.
Should this work?
Installation steps:
Composer.json
{
"name" : "mezzio/mezzio-skeleton",
"description" : "Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!",
"type" : "project",
"license" : "BSD-3-Clause",
"keywords" : [
"laminas",
"mezzio",
"skeleton",
"middleware",
"psr",
"psr-7",
"psr-11",
"psr-15"
],
"homepage" : "https://mezzio.dev",
"support" : {
"docs" : "https://docs.mezzio.dev/mezzio/",
"issues" : "https://github.com/mezzio/mezzio-skeleton/issues",
"source" : "https://github.com/mezzio/mezzio-skeleton",
"rss" : "https://github.com/mezzio/mezzio-skeleton/releases.atom",
"chat" : "https://laminas.dev/chat",
"forum" : "https://discourse.laminas.dev"
},
"config" : {
"sort-packages" : true
},
"extra" : {
"laminas" : {
"component-whitelist" : [
"mezzio/mezzio",
"mezzio/mezzio-helpers",
"mezzio/mezzio-router",
"laminas/laminas-httphandlerrunner",
"mezzio/mezzio-fastroute",
"mezzio/mezzio-laminasviewrenderer"
]
}
},
"require" : {
"php" : "^7.3 || ~8.0.0 || ~8.1.0",
"composer/package-versions-deprecated" : "^1.10.99",
"laminas/laminas-component-installer" : "^2.5.0",
"laminas/laminas-config-aggregator" : "^1.5.0",
"laminas/laminas-diactoros" : "^2.6.0",
"laminas/laminas-stdlib" : "^3.3.1",
"laminas/laminas-zendframework-bridge" : "^1.2.0",
"mezzio/mezzio" : "^3.5.0",
"mezzio/mezzio-helpers" : "^5.6.0",
"laminas/laminas-servicemanager" : "^3.4",
"mezzio/mezzio-fastroute" : "^3.0.3",
"mezzio/mezzio-laminasviewrenderer" : "^2.2"
},
"require-dev" : {
"laminas/laminas-development-mode" : "^3.3.0",
"mezzio/mezzio-tooling" : "^1.4.0",
"phpspec/prophecy" : "^1.10.3",
"phpspec/prophecy-phpunit" : "^2.0",
"phpunit/phpunit" : "^9.4.1",
"roave/security-advisories" : "dev-master",
"filp/whoops" : "^2.7.1"
},
"autoload" : {
"psr-4" : {
"App\\" : "src/App/src/"
}
},
"autoload-dev" : {
"psr-4" : {
"AppTest\\" : "test/AppTest/"
}
},
"scripts" : {
"post-create-project-cmd" : "@development-enable",
"development-disable" : "laminas-development-mode disable",
"development-enable" : "laminas-development-mode enable",
"development-status" : "laminas-development-mode status",
"mezzio" : "mezzio --ansi",
"check" : [
"@cs-check",
"@test"
],
"clear-config-cache" : "php bin/clear-config-cache.php",
"cs-check" : "phpcs",
"cs-fix" : "phpcbf",
"serve" : "php -S 0.0.0.0:8080 -t public/",
"test" : "phpunit --colors=always",
"test-coverage" : "phpunit --colors=always --coverage-clover clover.xml"
}
}