I'm creating very simple e-commerce platform and i'm stuck on meta tags. I have something like this (the code is very simplified of course :P):
class Blabla {
public $meta_title = 'zzzzzzz';
function pages() {
$this->meta_title = 'xxxxxx';
}
function title() {
return $this->meta_title;
}
}
Than i have index.php like this:
require_once('blabla.php');
$blabla= new Blabla();
<html>
(...)
<?php echo $blabla->title(); ?>
(...)
<?php echo $blabla->pages(); ?>
(...)
</html>
My question is how to run pages() first and display meta() correctly? I can add $this->pages() to __construct() but i think it's not the best way to solve my problem.