How to get the $id and $returnid from a module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Splynx
Forum Members
Forum Members
Posts: 20
Joined: Tue Jun 26, 2007 2:41 pm

How to get the $id and $returnid from a module

Post by Splynx »

Hello guys,

have been searching this forum for a solution - but found none.

I need to get the $id and $returnid used by DoAction files to create a link from outside the module (in an ajax file).

I have an instance of the module - how do I get the module $id and module $returnid?
Splynx
Forum Members
Forum Members
Posts: 20
Joined: Tue Jun 26, 2007 2:41 pm

Re: How to get the $id and $returnid from a module

Post by Splynx »

Still need it - what I mean is I need a way to get the $id and $returnid (this one I can get now though) from the $this object I get in my own methods of the module.

Basically I made a new function inside the module php file, and inside that I need a frontendlink made where I need to have the $id and $returnid.

How do I get the $id part? The first part of the link with stuff like:
IMtema,m0cfd6,

Please help - I can't make much sense of the API ???
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: How to get the $id and $returnid from a module

Post by Wishbone »

CG* modules define a {$module_id} (or similar) Smarty variable that can be used when a module is instantiated on a page.
User avatar
kidcardboard
Forum Members
Forum Members
Posts: 54
Joined: Mon Sep 28, 2009 5:25 pm

Re: How to get the $id and $returnid from a module

Post by kidcardboard »

Try assigning it to a smarty variable in the php file and then use it in the template.

Code: Select all

$smarty->assign('id', $id);
$smarty->assign('returnid', $returnid);
Post Reply

Return to “Developers Discussion”