Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8433871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:30:21+00:00 2026-06-10T06:30:21+00:00

I am using CodeIgniter’s anchor tag to generate links Here’s the code I am

  • 0

I am using CodeIgniter’s anchor tag to generate links

Here’s the code I am using in my view :

<?=anchor('blog/post/'.$row->id,$row->title);?>

Above code is rendering the url like

<a href="http://localhost/Blog/index.php/blog/post/3">Title</a>

I wanted to know other ways to embed other HTML elements within <a> tags ?

Output on HTML page should look like :

<a href="link" rel="bookmark"> 
    <span class="location">Category</span>
     <h3 class="headline">Headline</h3>
     <span class="new">New !</span>
    <span class="date">Date</span>
  </a>

ie. within <a> tags I want to embed <span> and <h3>

Any suggestions ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:30:23+00:00Added an answer on June 10, 2026 at 6:30 am

    Just use the second parameter of the anchor method, like this:

    $a ='<span class="location">Category</span>
         <h3 class="headline">Headline</h3>
         <span class="new">New !</span>
        <span class="date">Date</span>';
    
    <?=anchor('blog/post/'.$row->id,$a.$row->title,array("rel" => "bookmark"));?>
    

    Additionaly I added a third parameter which lets you write the html attributes for the tags like; in this case, the ‘rel’ attribute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using CodeIgniter, I am trying to place several images onto my view page as
I am using codeigniter and Jquery. I have an upload form in my view
I am using CodeIgniter's form validation . Here is an example: $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
I'm using CodeIgniter's form validation callback function, here is it: function _validate_rate($input, $field) {
I'm using CodeIgniter 2.1.2 and here's my situation right now. I have a model
I am using codeIgniter and am really stucked on it. Here's my model function
I'm using CodeIgniter 2.1 I use CodeIgniter's session to handle whether a user logged
I am using CodeIgniter to upload some files through a form. I know how
I'm using CodeIgniter + Zend libraries. I want to let users upload videos to
I'm using codeigniter framework and I'm getting this error when I've submitted my form:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.