codeigniter anchor-url helper Function anchor in codeigniter

codeigniter anchor-url helper Function anchor in codeigniter

In this post we will show you codeigniter anchor, hear for codeigniter anchor we will give you demo and example for implement.

hear we use codeigniter anchor as url helper Function anchor in codeigniter

anchor($set_uri = '', $set_title = '', $set_attributes = '')

Parameters:

  • $attributes (mixed) – HTML attributes
  • $title (string) – Anchor title
  • $uri (string) – URI string
  • Returns: HTML hyperlink (anchor tag)
  • Return type: string

Creates a typical html anchor link supported your native web site computer address.

The first parameter will contain any segments you want appended to the computer address. like the site_url() perform on top of, segments are often a string or associate array.




Note

If square measure|you’re} building links that are internal to your application don’t embody the bottom computer address (http://...). this can be else mechanically from the data laid out in your config file. embody solely the URI segments you want appended to the computer address.

The second section is that the text you’d just like the link to mention. If you allow it blank, the computer address are going to be used. The third parameter will contain an inventory of attributes you’d like else to the link. The attributes are often an easy string or associate associative array.

Here are some examples:


echo anchor('news/local/123', 'Anchor News', 'title="News Anchor"');
// codeigniter anchor Prints: <a href="http://onlinecode/index.php/news/local/123" title="News title">Anchor News</a>

echo anchor('news/local/123', 'Aanchor News', array('title' => 'The best news!'));
// anchor Prints: <a href="http://onlinecode/index.php/news/local/123" title="The best news!">Anchor News</a>

echo anchor('', 'Click for Anchor');
// codeigniter anchor Prints: <a href="http://onlinecode">Click for Anchor</a>

You may also like Remove index.php from url in codeigniter and CodeIgniter – Image and File Upload and JOIN Tables in Codeigniter

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  59  =  64

We accept paid advance and paid guest Posting on our Site : Contact US