I know that this as a question is more than duplicated, I've been reading around but due to my lack of expertise I haven't been able to apply any of the solutions to my case, actually, I did a similar question here where I partially solved my problem, so here's the thing:
File vars.php
<?php
$var = array(
"var1" => "Sample text1",
"var2" => "Sample text2",
"var3" => "Sample text3",
"var4" => "Sample text4",
"var5" => "Sample text5",
"var6" => "Sample text6",
);
?>
File apply.php
<?php
include ("vars.php");
class mouth {
private $teeth = array(
FIRST_EX=>'first text',
SECOND_EX=>'second text'
);
public $forms = array(
'signin'=>array(
'fields'=>array(
'username'=>array('type'=>'text','placeholder'=>'third text','icon'=>'envelope'),
'password'=>array('type'=>'password','placeholder'=>'fourth text','icon'=>'lock')
),
'submit'=> 'fifth text',
'message'=> 'sixth text'
);
?>
So all of the texts (first text, second text, third text, etc.) in file apply.php should be respectively changed by $var['var1']
, $var['var2]
, $var['var3]
, etc. to display, also respectively, Sample text1, Sample text2, Sample text3, etc.
So file apply.php should finally be more or less like this:
<?php
include ("vars.php");
class mouth {
private $teeth = array(
FIRST_EX=>'$var['var1']',
SECOND_EX=>'$var['var2']'
);
public $forms = array(
'signin'=>array(
'fields'=>array(
'username'=>array('type'=>'text','placeholder'=>'$var['var3']','icon'=>'envelope'),
'password'=>array('type'=>'password','placeholder'=>'$var['var4']','icon'=>'lock')
),
'submit'=> '$var['var5']',
'message'=> '$var['var6']'
);
?>
Can somebody guide me in how should the variables be represented to achieve this objective.... thanks a lot