Hello people. Sorry for posting into this part of the forum: Im waiting on my client to send me his EE licence so I can then post into the proper one - but need some feedback asap.
Im writing a module to compliment the member module - which will be a new module tab where you can fill out all of a members details in one hit from one page.
to make my life easier, id like to call functions from the cp.member.php file, such as update password etc. Im not advanced at php yet so might need someone to explain it to me if they dont mind taking the time to do so.
wouldnt it be something like:
require PATH_CORE.'core.update_password'.EXT;
but arent there other things I’d have to do in the new mcp.myModule.php? like declare the function etc..
any help appreciated 😊
Mod Edit: Moved to the Modules Technical Assistance forum.
ok, ill try that… But im not sure how to require the file…
require PATH_CORE - outputs the path to core folder core.module - a core module? (so if it wasnt a core file it would be module_folder.module. EXT - cover any extension?
then how do you call a class/function?
also, what is a hook and how do you use a hook? i.e.
$edata = $EXT->call_extension('cp_members_member_create_start');
if ($EXT->end_script === TRUE) return;
I can’t remember where those variables are set, but you can always just use the complete path and extension instead.
I would be careful of calling any functions in cp. as those look like they output to DSP (which is the Control Panel display).
As for calling a function, it would be something like this:
$m = new Member();
$m->function_to_call();
As for hooks, check out the docs
As for calling a function, it would be something like this:$m = new Member(); $m->function_to_call();
Awesome thanks, thats what im after… but I get this:
Fatal error: Class ‘Member’ not found in /etc/staff/mcp.staff.php on line 320
I guess that means that im not declaring the class somewhere? (remember Im new to this)
I think you should review some PHP basics before going on. The questions you are asking have nothing to do with EE; they have to do with how to do PHP. I too, frequently get stuck on PHP issues.
Which file are you including? Which class are you trying to access? Which method are you trying to access?
Originally i thought it would be possible to go to another form when submitting a new members, but after playing around and considering all of the requirements of the new form, it turned out that I had to basically have a whole new ‘pseudo-member’ function to work alongside the core member one.
it actually working quite well, but had to write an entire module for it.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.