0

The error is triggered from: C:/wamp/www/bayadko/fuel/core/classes/view.php @ line 440

This is my index.php

<?php foreach ($parent as $parent): ?>
    <h3><?php echo Html::anchor('blog/view'.$parent->user_id, $parent->password) ?></h3>
    <p><?php echo $parent->password ?></p>
<?php endforeach; ?>

This is my blog.php

<?php 
class Controller_Blog extends Controller_Base
{
  public function action_index() {
    $view = View::forge('blog/index');

    $view->parents = Model_Parent::find('all');

    $this->template->title = 'My Blog about Stuff';
    $this->template->content = $view;
  }
}
?>

What could be causing this error?

1

1 Answer 1

0

Controller_Base extends Controller_Template which uses template.php in the views folder to template out all of the pages in fuelphp for you. This is really helpful as is lets you abstract important things like html or css that's included on every page. All you have to do to resolve this is make a new file in the views folder called template.php. Here is some starter code to get you started on the template.php file.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo $title; ?></title>
    <?php echo Asset::css('bootstrap.css'); ?>
</head>
<body>
    <header>
        <div class="container">
            <?php echo $title; ?>
        </div>
    </header>
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <?php echo $content; ?>
            </div>
        </div>
        <hr/>
        <footer>
            <p class="pull-right">Page rendered in {exec_time}s using {mem_usage}mb of memory.</p>
            <p>
                <a href="http://fuelphp.com">FuelPHP</a> is released under the MIT license.<br>
                <small>Version: <?php echo Fuel::VERSION; ?></small>
            </p>
        </footer>
    </div>
</body>
</html>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.