anchor_popup()

anchor_popup($uri = '', $title = '', $attributes = FALSE)

Parameters:
  • $uri (string) – URI string
  • $title (string) – Anchor title
  • $attributes (mixed) – HTML attributes
Returns:

Pop-up hyperlink

Return type:

string

Nearly identical to the anchor() function except that it opens the URL in a new window. You can specify JavaScript window attributes in the third parameter to control how the window is opened. If the third parameter is not set it will simply open a new window with your own browser settings.

Here is an example with attributes:

$atts = array(
        'width'       => 800,
        'height'      => 600,
        'scrollbars'  => 'yes',
        'status'      => 'yes',
        'resizable'   => 'yes',
        'screenx'     => 0,
        'screeny'     => 0,
        'window_name' => '_blank'
);

echo anchor_popup('news/local/123', 'Click Me!', $atts);

Note

The above attributes are the function defaults so you only need to set the ones that are different from what you need. If you want the function to use all of its defaults simply pass an empty array in the third parameter: | | echo anchor_popup(‘news/local/123’, ‘Click Me!’, array());

Note

The window_name is not really an attribute, but an argument to the JavaScript window.open() <http://www.w3schools.com/jsref/met_win_open.asp> method, which accepts either a window name or a window target.

Note

Any other attribute than the listed above will be parsed as an HTML attribute to the anchor tag.

doc_CodeIgniter
2016-10-15 16:30:51
Comments
Leave a Comment

Please login to continue.