Using word_limiter() for table output
Suppose that you're making a CMS or some sort of admin interface and you're currently making a view which lists—oh I don't know—articles. Suppose that there are some articles in your database and you have to list them. It might be considered useful to the user of the CMS to provide them with a brief preview of the article so that they can be sure that they're deleting, editing, or just looking at the correct one. A preview—similar to the one found in an e-mail client—displays the first few lines, so that a user can be sure of what they're looking at. CodeIgniter comes with a handy function for limiting the number of words displayed from a string of text; this function is perfect for such a purpose. Here, we're ...
Get CodeIgniter 2 Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.