Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 12-17-2014 15:56:09

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Passing multiple variables to a namespace?

Good Afternoon,

I'm attempting to pass multiple variables to the following call

Code:

<?php $this->include_namespace('cms','my_method', 'reference_string'); ?>

I would like to pass the following variables to it

Code:

function my_method ($reference = '', $width, $height, $color, $etc) {

I've noticed it being done with the sql method

Code:

 
$result  = $this->CORE_DB->sql_do(array('sql'   => $sql,
                                        'table' => $table,
                                        'order' => array('sortorder' => 'ASC')));

as well as this in CMS_Content

Code:

$this->exec_namespace(array('app'       => 'cms',
                                 'namespace' => 'pagesubmenu',
                                 'type'      => 'INTERNAL',
                                 'params'    => array('id' => $result[0]['id'], 'name' => '')));


-James Garrett

Offline

 

#2 12-17-2014 15:57:47

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Re: Passing multiple variables to a namespace?

I should add that-- exec_namespace might work for me, I'm not sure what the difference is between exec_namespace and include_namespace



-James Garrett

Offline

 

#3 12-19-2014 19:06:59

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Passing multiple variables to a namespace?

CORE_Display->include_namespace() is just a simpler interface which frontends CORE_App->exec_namespace() so you don't have to write a ton of options into your includes that you'll never use.  Either way, pass your params as a single array with multiple named keys, if you have multiple values you want to pass into the function being called by the namespace you've created.


Nick Hendler

Offline

 

Board footer