Welcome Guest, Not a member yet? Register   Sign In
CI3 - having problem with News tutorial
#1

Hi everyone,

Im really excited about CI and hope to become good enough with it one day that I may contribute in some way.

Meantime, I was following along the New tutorial

(a) The link did not wrk -- it just stays on the same page
(b) The index file seems to have an error ...

The tutorial page says to code index.php as ...

<h2><?php echo $title; ?></h2>
<?php foreach ($news as $news_item): ?>
       <h3><?php echo $news_item['title']; ?></h3>
       <div class="main">
               <?php echo $news_item['text']; ?>
       </div>
       <p><a href="<?php echo site_url('news/'.$news_item['slug']); ?>">View article</a></p>
<?php endforeach; ?>




but I coded it ...

<h2><?php echo $title; ?></h2>
<?php foreach ($news as $news_item): ?>
        <h3><?php echo $news_item['title']; ?></h3>    <div class="main">
        <?php echo $news_item['slug']; ?>
    </div>
    <p><a href="<?php echo site_url('news/'.$news_item['slug']); ?>">View</a>   
<?php endforeach; ?>

My reasoning is ...

The title of the news is to be displayed along with the slug below t (which is a brief summary).
Then... after the person clicks on the link, the text of the news will be displayed.

As it is taught, the title and the full text displays.

Please correct me if I am wrong.
I really want to learn CI and so I welcome all corrections and suggestions.

FINALLY ....


Except for that one line I indicated above, the link does not work.
Even if I leave that one line of code as indicated, the link still does not work ... t simply stays on the same line.

Any help will be appreciated.

Thank You in advance.
-------------------------------------------------
CI is the best framework for me - period
------------------------------------------------
Reply


Messages In This Thread
CI3 - having problem with News tutorial - by cisite - 01-31-2016, 09:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB