Professional Documents
Culture Documents
index.php display.php
enter.php
footer.php
controller
Add directory called “model”
Create a read function in
test_functions.php
<?php
function read_comments(){
return array( array( id => 1,
date => '12/15/2014',
name => 'Brendan',
message => 'Did we do anything important in class?' ),
array( id => 2,
date => '11/09/2014',
name => 'Joe',
message => 'Hey you know…' ),
array( id => 3,
date => '1/23/2015',
name => 'Taquila',
message => 'Grey makes my eyes cry' )
);
}
?>
Call the function from index.php
and pass data to display.php
model view
<?php
test_functions.php header.php
require('./model/test_functions.php');
<h2>Comments</h2>
</div>
<?php include('footer.php'); ?>
Now you should have…