inside the user component syntax help
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
inside the user component syntax help
to do with users in this case
function userEdit( $row, $option, $submitvalue, &$params )
I've never come across this syntax for an argument, how is it used? what will it change?
also what does this do
require_once ( $mainframe->getPath( 'front_html' ) );
thanks
m
function userEdit( $row, $option, $submitvalue, &$params )
I've never come across this syntax for an argument, how is it used? what will it change?
also what does this do
require_once ( $mainframe->getPath( 'front_html' ) );
thanks
m
Last edited by mojito on Wed Dec 14, 2005 11:42 am, edited 1 time in total.
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- RobS
- Joomla! Ace
- Posts: 1366
- Joined: Mon Dec 05, 2005 10:17 am
- Location: New Orleans, LA, USA
- Contact:
Re: inside the user component syntax help
In your first question, are you asking how to pass an argument to a function? Or something else?
As for the second question.
require_once ( $mainframe->getPath( 'front_html' ) );
Is saying that this file, is trying to include another file, which is the nave of the component.html.php. front_html is basically an internal variable constant referring to the components .html.php file, which is used normally to do the actual html presentation.
As for the second question.
require_once ( $mainframe->getPath( 'front_html' ) );
Is saying that this file, is trying to include another file, which is the nave of the component.html.php. front_html is basically an internal variable constant referring to the components .html.php file, which is used normally to do the actual html presentation.
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
Re: inside the user component syntax help
That helps me a lot as I couldnt see any includes for the components constructed with html.php files and .php files, that must be the line.
For the first part the bit I dont get is the "&" just before the argument$params, does this concatenate the current $params with new $params ?
thanks
c
For the first part the bit I dont get is the "&" just before the argument$params, does this concatenate the current $params with new $params ?
thanks
c
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- RobS
- Joomla! Ace
- Posts: 1366
- Joined: Mon Dec 05, 2005 10:17 am
- Location: New Orleans, LA, USA
- Contact:
Re: inside the user component syntax help
A '&' in php is actually used to pass a variable as a reference, so &$params means pass the memory location of $params, instead of making a copy of $params for that function. It is intended to cut down on unnecessary memory usage, and to make your program faster. However, it is optional. It would be ok to pass $params as the argument, however, if you do any changes to the $params variable inside your function, you will have to return $params upon completion, and update it outside of the function. So, in most cases, it is easier and faster to pass it as a reference using the & operator. Of course, there are instances when this is not ideal, and it is better to pass a copy of %params instead of having the function use a global $params.
Hope that helps.
Hope that helps.
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
Re: inside the user component syntax help
Very well put, thanks.
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
Re: inside the user component syntax help
Im getting the following error when trying to use the above instead of just including (in this case) "display.html.php";RobS wrote: In your first question, are you asking how to pass an argument to a function? Or something else?
As for the second question.
require_once ( $mainframe->getPath( 'front_html' ) );
Is saying that this file, is trying to include another file, which is the nave of the component.html.php. front_html is basically an internal variable constant referring to the components .html.php file, which is used normally to do the actual html presentation.
Code: Select all
Fatal error: Call to a member function getPath() on a non-object in C:\Uniform3_1_1s\www\landedAt\components\com_journal\journal.php on line 113
thanks for any help
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- Predator
- Joomla! Ace
- Posts: 1823
- Joined: Wed Aug 17, 2005 10:12 pm
- Location: Germany-Bad Abbach
- Contact:
Re: inside the user component syntax help
Your component is named com_journal so the display.html.php has to renamed to journal.html.phpmojito wrote:Im getting the following error when trying to use the above instead of just including (in this case) "display.html.php";RobS wrote: In your first question, are you asking how to pass an argument to a function? Or something else?
As for the second question.
require_once ( $mainframe->getPath( 'front_html' ) );
Is saying that this file, is trying to include another file, which is the nave of the component.html.php. front_html is basically an internal variable constant referring to the components .html.php file, which is used normally to do the actual html presentation.the object doesnt exist, ive tried the line global $mainframe which doesnt work.Code: Select all
Fatal error: Call to a member function getPath() on a non-object in C:\Uniform3_1_1s\www\landedAt\components\com_journal\journal.php on line 113
thanks for any help
The "Humor, Fun and Games" forum has more than 2500 Posts, so why not build a "Humor, Fun and Games Working" Group?
.....
Malicious tongues say we have this WG right from the start, they call it core team
.....
Malicious tongues say we have this WG right from the start, they call it core team
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
Re: inside the user component syntax help
But it is a separate template from journal.html.php. I want to have many templates for this component. Does this mean that I just should use
require(display.html.php);
is there anything wrong with that cause this works.
thanks
require(display.html.php);
is there anything wrong with that cause this works.
thanks
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- rontec76
- Joomla! Intern
- Posts: 85
- Joined: Tue Aug 23, 2005 4:27 am
- Contact:
more pagination questions
Ian (or anyone else),
Is there a fairly straight forward way, or some class already defined in Joomla that I can use to dump my $_POST vars into an array and use sessions to pass them along in the component?
that way I don't have to rely passing everything along via the URL?
Is there a fairly straight forward way, or some class already defined in Joomla that I can use to dump my $_POST vars into an array and use sessions to pass them along in the component?
that way I don't have to rely passing everything along via the URL?
- Predator
- Joomla! Ace
- Posts: 1823
- Joined: Wed Aug 17, 2005 10:12 pm
- Location: Germany-Bad Abbach
- Contact:
Re: inside the user component syntax help
The getPath directly by using with front_html, class etc is limit to only this files, for other you need to use require.mojito wrote: But it is a separate template from journal.html.php. I want to have many templates for this component. Does this mean that I just should use
require(display.html.php);
is there anything wrong with that cause this works.
thanks
The "Humor, Fun and Games" forum has more than 2500 Posts, so why not build a "Humor, Fun and Games Working" Group?
.....
Malicious tongues say we have this WG right from the start, they call it core team
.....
Malicious tongues say we have this WG right from the start, they call it core team
- mojito
- Joomla! Guru
- Posts: 755
- Joined: Wed Sep 07, 2005 10:18 pm
- Location: London
- Contact:
Re: more pagination questions
I would like to know more on that as well here http://forum.joomla.org/index.php/topic,23929.0.html so we dont go off topic.rontec76 wrote: Ian (or anyone else),
Is there a fairly straight forward way, or some class already defined in Joomla that I can use to dump my $_POST vars into an array and use sessions to pass them along in the component?
that way I don't have to rely passing everything along via the URL?
I am a freelance SEO (https://cambs.eu) web designer and developer working with Wordpress and Joomla since Mambo.
- rontec76
- Joomla! Intern
- Posts: 85
- Joined: Tue Aug 23, 2005 4:27 am
- Contact:
Re: inside the user component syntax help
sorry...
somehow in one of late nights i accidentally posted this here...
sorry to be in the wrong topic...
somehow in one of late nights i accidentally posted this here...
sorry to be in the wrong topic...