Larry Vollmer
asked on
PHP question
I have this block of code
<?php
echo $html->css(
'/hp_events/css/ftaf2',
'stylesheet',
array( 'media' => 'screen'));
?>
A coder told me to convert it using $this->html->css - but I am not sure if I am following what he means. can anyone help?
<?php
echo $html->css(
'/hp_events/css/ftaf2',
'stylesheet',
array( 'media' => 'screen'));
?>
A coder told me to convert it using $this->html->css - but I am not sure if I am following what he means. can anyone help?
ASKER
when I try that, i get this error:
Fatal error: Call to a member function css() on a non-object
Fatal error: Call to a member function css() on a non-object
I think the coder meant for you to put $this in from of the code, see below
<?php
echo $this->html->css(
'/hp_events/css/ftaf2',
'stylesheet',
array( 'media' => 'screen'));
?>
ASKER
that is what i first thought, but when i use that code i still get that error
this code is from calling a class, can you show us the class?
maybe it is $this->css ? And what is the error message you are getting?
ASKER
Fatal error: Call to a member function css() on a non-object
Oh duh, right, you did say that. Can we see the class?
ASKER
im trying to figure out how to find that
Are you on a CMS, or custom coded website?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any chance that you are working with a cakePHP site? are you trying that code inside a view (a .ctp file)?
ASKER
yes this is cakephp and it is a .ctp template
ASKER
the cap H worked - thanks! and yes this was cakephp
'/hp_events/css/ftaf2',
'stylesheet',
array( 'media' => 'screen'));