We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Output Template Global Variables with php

Development and Programming

jhsnowboard's avatar
jhsnowboard
3 posts
13 years ago
jhsnowboard's avatar jhsnowboard

Hi, I have made some global variables in the template manager, and I was wondering how to output them with PHP, as I need it on Input.

Thanks!

       
Bhashkar Yadav's avatar
Bhashkar Yadav
727 posts
13 years ago
Bhashkar Yadav's avatar Bhashkar Yadav

Hi,

You can use following code :

$this->EE =& get_instance();
$this->EE->db->select('variable_data');
$this->EE->db->from('global_variables');
$this->EE->db->where('variable_name', '[GLOBAL VARIABLE NAME]');
$this->EE->db->where('site_id', $this->EE->config->item('site_id'));

$value = $this->EE->db->get()->row('variable_data');
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.