• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
url library/anchor function for content on database content

I have need for an anchor tag embedded within content drawn from the database for the application I am working on. Yet, for some reason CI is not executing the anchor function.

These are relevant sections within my controller for this app
class Main extends CI_Controller {
function __construct() {

public function index() {
  $query = "SELECT id, recipe, instruc FROM main WHERE id='".$id."'";
  if ($recipe) {
   $data['recipe_title'] = $recipe['recipe'];
   $data['recipe_instruc'] = $recipe['instruc'];
   $data['navigation'] = $this->main_model->buildMenu();

In my View, url helper is also loaded and the value from the $data array echoed with appropriate syntax:
<?php echo $recipe_instruc?>

The section of text returned from the database is as follows:
Serve over ice cream or <?php echo anchor('main/index/7', 'profiteroles');?>

The above quoted text is a snippet of the overall block of text returned from the database. All the rest of the text echos properly to the view. The section of text that should echo as a coded anchor tag does not.

I can understand the anchor function not being executed at the Controller level but it should execute at the View level, no?

Messages In This Thread
url library/anchor function for content on database content - by El Forum - 09-26-2011, 04:58 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.