Jump to content
Sign in to follow this  
in2tech

Blade Templating & Routes - Static Page

Recommended Posts

So I created a static About Us page for my theme in phpVMS 7. Here is the code in the app/routes/web.php file:

    Route::get('/about', function () { return view('about.about'); });

It's just a very simple function to return a view as this is the only way I know how to do it at this time. So my views folder for my template has (template name)/About (folder)/about.blade.php and it works but it seems confusing to me. Should I have named the file index.blade.php and put it in the About folder. Seems like this is how other blade templates are referred too in the code?

 

Thanks, guess I'll just try it and see if it works! So instead of what i have now it would look like this:

 

	    Route::get('/about', function () { return view('about.index'); });
	

So look in the theme folder and then the About folder and return the view index.blade.php!
 

Edited by in2tech

Share this post


Link to post
Share on other sites

It does indeed work that way and now I know why most are like that. Better than about.about now it is about.index. Look in the About folder and get the file index.blade.php and output it to the views, nice!

web.php file in the App/Routes folder!

2018-10-21_1707

 

Folder for my NEW v7 theme!

2018-10-21_1707

 

This is just a static page, I have no clue as to how or if we can make page modules at this time in v7!

Edited by in2tech

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×