Closed trompx closed 5 years ago
The following correct the issue:
namespace App\Controllers\Web;
But creates another issue:
Call to undefined function App\Controllers\Web\WPEmerge\view()
Using finally works:
return \WPEmerge\view( 'templates/home' );
I think adding this simple controller + simple view + simple route in the starter theme or at least having the proper doc would help others.
The doc here https://docs.wpemerge.com/#/framework/0-to-100-setup is confusing as it does not take into account the new folder structure (Controllers/Web-Admin...)
You are correct - the docs are slightly outdated and missing the new directory structure. I will be updating them shortly.
Docs are updated (cache may apply) - let me know if you stumble upon any other inaccuracies: https://docs.wpemerge.com/#/framework/0-to-100-setup
Version
Expected behavior
Home controller home method should be called
Actual behavior
The route is not going through the home controller
Comments
I added in src/Controllers/Web/HomeController.php
In routes/web.php, the following is not working
Route::get()->url( '/' )->handle( 'HomeController@index' );
while the following return the expected template
May I suggest you add to the starter theme basic usage like first route + first controller so it is easier for people to start / replace.