Advertisement

List of variables

For Joomla! 1.0 Coding related discussions.
Locked
littleprince
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Thu Oct 27, 2005 3:46 pm
Location: Toronto
Contact:

List of variables

Post by littleprince » Fri Feb 09, 2007 9:08 pm

I'm developing a custom module and don't often develop from scratch in PHP and joomla.

Is there a list of predefined user variables? content variables?

For example:
Is there a variable or a function to get the category ID of a content page?
I know I can get the ID from the URL, and select it from the database.

But I was thinkg there must be something like $my->gid because it must be used a lot.

Advertisement
jim_d
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Feb 26, 2007 1:29 am

Re: List of variables

Post by jim_d » Mon Feb 26, 2007 1:50 am

What a great, straightforward question!  I'm looking for the same answer, but obviously either there isn't or we're not using the right 'jargon'.

stzzo
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Fri May 19, 2006 4:39 am

Re: List of variables

Post by stzzo » Mon Feb 26, 2007 5:46 am

What I often do is put this code at the bottom of the template:

Code: Select all

<?php echo '<pre>' . print_r($GLOBALS, true) . '</pre>' ?>
It will display all global variables so you can look for one that works.  Obviously, you don't want this to appear to everyone  - you can put it in a module that's only accessible to you ("special" access).

runey
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Wed Jan 31, 2007 4:03 am
Location: Adelaide, Australia
Contact:

Re: List of variables

Post by runey » Mon Feb 26, 2007 7:32 am

Thanks for that... Should help heaps :D
Jason Hart (aka runey)
TrekCon
Your one stop site for all sci-fi / fantasy convention information
http://trekcon.com

jim_d
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Feb 26, 2007 1:29 am

Re: List of variables

Post by jim_d » Mon Feb 26, 2007 12:59 pm

Yeah, thanks! Great tip. And thanks for the quick reply, too.

User avatar
yustar2000
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Fri May 12, 2006 2:16 am
Location: China
Contact:

Re: List of variables

Post by yustar2000 » Wed Feb 28, 2007 2:01 am

good way list all global varable

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: List of variables

Post by ianmac » Wed Feb 28, 2007 8:03 am

You can also try here:
http://api.joomla.org/li_Joomla-Legacy.html

For information about the API.

Global objects are $my (user), $database (database - duh), $mainframe - the application, there are a few more I think, but I don't recall offhand.

Ian

Advertisement

Locked

Return to “Joomla! 1.0 Coding”