Closed webafra closed 5 years ago
The docs have some misleading examples on this which I will be updating shortly.
The problem comes from the missing leading \
so the usage should be like this:
\WPEmerge\view( ... );
instead of this:
WPEmerge\view( ... );
The second usage works when you are in a file that does not have a namespace definition but controllers usually do so the absolute namespace form has to be used (i.e. the leading \
).
All namespaced function usage in the docs has been updated: https://docs.wpemerge.com/#/framework/overview
Route::get()->url( '/hello' )->handle( function() { return WPEmerge\view( 'templates/about-us.php' )->withStatus( 200 ); } );
Error : Call to undefined method WPEmerge\View\PhpView::withStatus()