V
V
Vladislav Rudakevich2021-05-21 10:46:43
PHP
Vladislav Rudakevich, 2021-05-21 10:46:43

How to properly navigate through the pages of the site?

Maybe I didn't word my question quite right.
I'm making my own website and just gaining experience. I intend to stick to the MVC model, but got stuck when implementing the "navigation" of the site. That is, I have, for example, a header with a logo and other things, there is a menu, and there is a central panel where everything happens. And I can't figure out how to put the content I need into this central part. So far, I've made a crutch like this on Smarty:

{if isset($group_id) }
  {include file="group_control.tpl"}
{else if $do == 'settings'}
  {include file="settings.tpl"}
{else if $do == 'profile'}
  {include file="profile.tpl"}
{/if}


I understand that it shouldn’t be like this, but I couldn’t find how to do it normally, I hope you tell me how to do it right.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kentavr16, 2021-05-21
@Kentavr16

by the way, you can start with this.
I think you should familiarize yourself with routing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question