Development

#3166 (Askeet tutorial page 5 _link.php, code provided by SVN link does not work)

You must first sign up to be able to contribute.

Ticket #3166 (new documentation)

Opened 9 months ago

Askeet tutorial page 5 _link.php, code provided by SVN link does not work

Reported by: rivaco Assigned to: fabien
Priority: minor Milestone:
Component: askeet Version: 1.0.10
Keywords: Cc:
Qualification: Unreviewed

Description

First error was on line one:

<?php use_helpers('Text', 'Question') ?>

I replaced it with

<?php use_helper('Text') ?>

And no error on line 1 at least.

Then i got an error on line 17, within the paginator. Decide do copy ainything within that div from the old listSuccess.php.

Everything seems to work now.

Maybe that code ought to have been inside on the 'day5' page rather then to rely on the SVN?

Anyhow, here's my '_list.php':

<?php use_helper('Text') ?>

<?php foreach($question_pager->getResults() as $question): ?>
  <div class="interested_block">
    <?php echo include_partial('interested_user', array('question' => $question)) ?>
  </div>

  <h2><?php echo link_to($question->getTitle(), 'question/show?stripped_title='.$question->getStrippedTitle()) ?></h2>

  <div class="question_body">
    <?php echo truncate_text($question->getBody(), 200) ?>
  </div>
<?php endforeach ?>

<div id="question_pager">
<?php if ($question_pager->haveToPaginate()): ?>
  <?php echo link_to('&laquo;', 'question/list?page=1') ?>
  <?php echo link_to('&lt;', 'question/list?page='.$question_pager->getPreviousPage()) ?>
 
  <?php foreach ($question_pager->getLinks() as $page): ?>
    <?php echo link_to_unless($page == $question_pager->getPage(), $page, 'question/list?page='.$page) ?>
    <?php echo ($page != $question_pager->getCurrentMaxLink()) ? '-' : '' ?>
  <?php endforeach; ?>
 
  <?php echo link_to('&gt;', 'question/list?page='.$question_pager->getNextPage()) ?>
  <?php echo link_to('&raquo;', 'question/list?page='.$question_pager->getLastPage()) ?>
<?php endif; ?>
</div>