I generated my bundle with netbeans with no error , then went to my main config file in the app directory and set this:
first_app:
resource: "@FirstAppBundle/Resources/config/routing.yml"
prefix: /
Then set this in my bundle routing.yml file:
first_app_homepage:
pattern: /hello/{name}
defaults: { _controller: FirstAppBundle:Hello:index }
I have got this controller:
namespace DimaVendor\MytestsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class HelloController extends Controller {
public function indexAction($name) {
return new Response('<html><body>' . $name . '</body></html>');
}
}
I get 404 when I go to there:
http://localhost/app.php/hello/Ryan
why?
I also cleaned my cache and found no error
app.phpandapp_dev.phpscripts are the entry points for Symfony apps, and they lie inweb/subfolder in the project – in this case, point your browser to:http://localhost/PhpProject1/web/app_dev.php/hello/Ryan.htaccesscomes inweb/folder, and redirects any requests to:to:
in your case. Have a look!