Jump to content

access $config inside function


pogidude
 Share

Recommended Posts

Hi,

I'm trying to do the following inside a function:

function register_styles(){
   $url = $config->urls->templates.'styles/';

   /** for working with google fonts **/
   $fonts = array(
      'Source+Sans+Pro:300,400,700',
      'Dosis:400,700'
      );

   $styles = array(
       'google-fonts' => 'http://fonts.googleapis.com/css?family=' . implode('|', $fonts )
      ,'bootstrap' => $url.'bootstrap.css'
      ,'base' => $url.'base.css'
      ,'structure' => $url.'structure.css'
      ,'design' => $url.'design.css'

      );

   return $styles;
} 
but I'm getting an error on this
$config->urls->templates.'styles/'
"Call to a member function add() on a non-object"

thanks for helping

Link to comment
Share on other sites

  • 10 months later...

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...