Welcome Guest, Not a member yet? Register   Sign In
Problem quotes
#1

[eluser]sparky2910[/eluser]
Code:
echo '<a class="btn btn-info" href=".'site_url(">Info </a>';

Please why doesn't work it ?[/code]
#2

[eluser]CroNiX[/eluser]
There's several things wrong with that, like you are missing a . for string concatenation and you only have 3 single quotes, which means a mismatch.

Code:
<a class="btn btn-info" href="&lt;?php echo site_url('controller/method'); ?&gt;">Info</a>

or use the anchor() helper http://ellislab.com/codeigniter/user-gui...elper.html
Code:
$this->load->helper('url');
echo anchor('controller/method', 'Info', array('class' => 'btn btn-info'));
#3

[eluser]jonez[/eluser]
Code:
echo '<a class="btn btn-info" href="' . site_url( ) . '">Info </a>';
You can use either ' or " as a deliminator but you have to use the same character on both sides. In your case a single quote, then append with a . to another string and function calls have two parenthesis (parameter's if any go inside).

When you print to the screen you should use the output class: http://ellislab.com/codeigniter /user-guide/libraries/output.html
#4

[eluser]sparky2910[/eluser]
Thanks




Theme © iAndrew 2016 - Forum software by © MyBB