jeudi 29 mars 2018

How to show specific text based on page path using a php function

I am using on a multipage website built in php that uses a global footer in its own blade. When a page blade loads in content for the body, it calls upon the global footer blade to import content for the footer. This way I only need to make changes in the global footer blade instead of every page.

Want I want to do now, is to create a conditional statement in my footer that allows me to load content depending on the page path.

For example:

animals.com/foxes/basics Load in content in the footer about foxes.

animals.com/bears/info Load in content in the footer about bears.

This info is based on the path having bears vs foxes, and affects alls child pages in that path.

Any advice on how to get started with using a PHP conditional that looks at the path in a URL or site? Any help would be appreciated!




Aucun commentaire:

Enregistrer un commentaire