Welcome Guest, Not a member yet? Register   Sign In
How do I had href to language file.
#1

[eluser]razerone[/eluser]
Hi I would like to know if it is possible to link href to language file.

Code:
$lang['text_powered'] = "Copyright © 2013, Your Name All rights reserved.";

$lang['text_powered'] = "Copyright &copy; 2013, <a href="&lt;?php echo base_url();?&gt;">Your Name</a> All rights reserved.";

Came up with a error when added a href
#2

[eluser]Tpojka[/eluser]
It is, but you do that on different way - with concatinetion of strings:

[code]
$lang['text_powered'] = "Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.";
[code]

p.s. Take care with quote marks.
#3

[eluser]razerone[/eluser]
[quote author="Tpojka" date="1383733170"]It is, but you do that on different way - with concatinetion of strings:

Code:
$lang['text_powered'] = "Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.";

p.s. Take care with quote marks.[/quote]

Just trying so if the click yourname/businessname if will go to home page. I though href would work will try it that way if not not to worry language files coming along well.

all my footer is done with language file footer_lang.php
#4

[eluser]razerone[/eluser]
[quote author="Tpojka" date="1383733170"]It is, but you do that on different way - with concatinetion of strings:

Code:
$lang['text_powered'] = "Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.";

p.s. Take care with quote marks.[/quote]

Just trying so if the click yourname/businessname if will go to home page. I though href would work if not not to worry language files coming along well.

all my footer is done with language file footer_lang.php
#5

[eluser]razerone[/eluser]
[quote author="Tpojka" date="1383733170"]It is, but you do that on different way - with concatinetion of strings:

Code:
$lang['text_powered'] = "Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.";

p.s. Take care with quote marks.[/quote]

Got it. can you provide me a link how to learn that stuff what section it would be under.
#6

[eluser]Tpojka[/eluser]
Just work other stuff.
It is PHP logic. When you echoing strings, you can do that with concetination.
Also you have to understand CodeIgniter logic: what file is loaded, when it is loaded and similar things.
That can't be done overnight, just with practice and fixing the errors.
When you overmaster basic PHP and PHP OOP and PHP MVC, it will be much more easier to understand CI or any other framework.
Your logic need to work this way:
Code:
$lang['text_powered'] = "Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.";

Aha, $lang['text_powered'] is element or key text_powered of $lang array. It's value is
Copyright &copy; 2013, <a href=" . base_url() . ">Your Name</a> All rights reserved.
So what should I do with that string? How to represent or change it?
It is something you can't find in user guide obviously. For that you have to read php.net or watch videos on yt.




Theme © iAndrew 2016 - Forum software by © MyBB