PHP - How to handle including content? -


for particular project, not require huge mvc framework, going how used write php applications:

header.php  footer.php   -- pages  index.php 

but, using frameworks, such laravel templating engine blade have got used when creating header.php use (e.g.):

<html> <head>    <title>test</title> </head> <body>   @yield('content') </body> </html> 

then in of pages:

@section('content')  @stop  

no, moving old standard, having this:

in header:

if(function_exists("content")) {       content();  } 

then in of pages:

  function content()   { ?>  test  <?php  } ?> 

as can see, not appealing @ all.

does know of alternative way of doing similar blade (without using blade)? or of way makes process more easy understand , lot less messy?

even if don't feel it's necessary use mvc framework build application it'd still best choice because there's taken care of authentication , security side of things massive chores take care of on own.

a full blown laravel installation may touch heavy weight , feel overbearing there's lumen framework stripped out super lightweight version of laravel kind of circumstance full fat version bit heavy, should check out if you're familiar it's bigger brother might need; https://lumen.laravel.com/

a couple of other micro frameworks silex exist might project, if you're familiar laravel advice lumen install , running, you're off races working in familiar environment that's still lightning fast , secure :)


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -