MSU Masthead

Metlab CourseLib Adding Cirsim to a page

cl/cirsim

This is a basic CourseLib page using the site View class:

<?php
require 'site.php';
$view = new \CL\Site\View($site);
$view->title = "Example Page";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo $view->head(); ?>
</head>
<body>

<?php echo $view->header(); ?>

<p> Page content</p>

<?php echo $view->footer(); ?>
</body>
</html>

You add Cirsim to a page using the CirsimViewAux object, then call present to add Cirsim to the page:

<?php
require 'site.php';
$view = new \CL\Site\View($site);
$cirsim = new \CL\Cirsim\CirsimViewAux();
$view->add_aux($cirsim);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo $view->head(); ?>
</head>
<body>

<?php echo $view->header(); ?>

<?php echo $cirsim->present(); ?>

<?php echo $view->footer(); ?>
</body>
</html>