Post by TheSponge » Fri Jul 22, 2011 10:49 pm

Hello again,
Ive now got my head around the complete structure of opencart, i understand a lot more that Ive gone through the framework and messing about with the files, but what does %s do?

from php manual site, its declaring an absolute string from a function, I see it pops up in all the language files and it always represents different values, can someone help explain what this varable does? and how it works in relation to the database and files?

User avatar
New member

Posts

Joined
Sat Mar 12, 2011 10:35 pm

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by TheSponge » Fri Jul 22, 2011 11:14 pm

I did ;) doesnt make sense to be honest...

User avatar
New member

Posts

Joined
Sat Mar 12, 2011 10:35 pm

Post by TheSponge » Fri Jul 22, 2011 11:20 pm

$this->data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));

this is it isnt it? it displays the variables in order?

User avatar
New member

Posts

Joined
Sat Mar 12, 2011 10:35 pm

Post by uksitebuilder » Fri Jul 22, 2011 11:26 pm

bingo

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by TheSponge » Fri Jul 22, 2011 11:34 pm

Thankyou sir! makes a bit more sense, but why not just echo or print the actual variables? why use sprintf?
why not have "powered by '$sitename' + '$date'" or something?

(apologies, this is now getting into a PHP topic, and not opencart! )

User avatar
New member

Posts

Joined
Sat Mar 12, 2011 10:35 pm

Post by uksitebuilder » Fri Jul 22, 2011 11:37 pm

There are always more than two ways to skin a cat ;-)

By the way, our logos are eerily similar - hehe

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by TheSponge » Fri Jul 22, 2011 11:42 pm

I shall do some reading then! by the way nice site you run, looks very fresh, looks like we are in the same business ;)

User avatar
New member

Posts

Joined
Sat Mar 12, 2011 10:35 pm
Who is online

Users browsing this forum: Amazon [Bot], Majestic-12 [Bot] and 11 guests