Jump to content

A php function not working inside a template?


FuturShoc
 Share

Recommended Posts

Is the page title already all caps? ucwords needs a strtolower first if that is the case. Although you tested diogo's suggestion, so I am guessing this is probably not the problem unless the string you tried was all caps as well.

Do other php functions work in that context, or is it just ucwords that doesn't work?

Link to comment
Share on other sites

Works fine here...

echo $page->title; // meine seite
echo ucwords($page->title); // Meine Seite
echo ucwords(strtoupper($page->title)); // MEINE SEITE
echo strtoupper($page->title); // MEINE SEITE (btw)
 
:)

Edit: Corrected nonsensical code :D

Edited by kongondo
Link to comment
Share on other sites

This doesn't make any sense :D

Actually I think it is kind of a useful example that highlights what Martijn and I said above. 

ucwords won't work on capitalized strings, which is why that example of kongondo's doesn't show Meine Seite

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...