Reputation: 70
<div id="one">
<?php foreach($m_post as $row){ ?>
<!-- medium -->
<div id="profile-page-wall-post" class="col s4 card">
<div class="card-profile-title">
<div class="row">
<div class="col s10">
<span class="grey-text text-darken-1 ultra-small">Shared publicly on <?php echo $row->date_added; ?></span>
</div>
</div>
</div>
<div class="card-image profile-medium">
<?php foreach(unserialize($m_post[0]->post_image) as $a){ ?>
<img src="<?php echo base_url()."assets/".$a?>" alt="sample" class="responsive-img profile-post-image profile-medium">
<?php } ?>
<span class="card-title">Card Title</span>
</div>
<div class="card-content">
<p><?php echo word_limiter($row->post,15); ?></p>
</div>
<center>
<button type="button" class="btn btn-default" style="background-color:#00BCD4">Edit</button>
<button type="button" class="btn btn-default" style="background-color:#00BCD4">Delete</button><br><br>
</center>
</div>
<!-- medium video -->
<br><br>
Here I have to limit the words which comes from database upto 15 only in codeigniter. But it shows this error:
Fatal error: Call to undefined function word_limiter() in /opt/lampp/htdocs/ci/post/application/views/my_admin/profile1.php on line 172
Upvotes: 1
Views: 2779
Reputation: 3794
Fatal error: Call to undefined function word_limiter()
Your Error Clearly Shows that You Need to load the helper first. Here is the Code.
function __construct()
{
parent::__construct();
$this->load->helper('text');
}
Upvotes: 2