Jump to content

Blade Templating & Routes - Static Page


Recommended Posts

Posted (edited)

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
Posted (edited)

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...