PHP code modification

Questions related to customising nuBuilder Forte with Javascript or PHP.

PHP code modification

Postby Janusz » Mon Jun 10, 2019 11:15 am

Hi,
I wanted to try to do some adaptation of one function but now I have one blocking point.
When I am checking with nuDebug the current array value - I have data as in the first box. So I wrote some code (in the second box) which is suppoused to generate results exactly as in the first box.
but can not get the same result despite many trials (the main problem is stdClass Object) - one of the results as example is in the last box.
And the question how to modify my code (from second box) that it will generate result exactly as visible in the first box?
Code: Select all
[0] : Array
(
    [0] => stdClass Object
        (
            [title] => Hotele - Miejsce
            [display] => hot_miejsce
            [align] => l
            [width] => 450
            [order] => 10
            [format] =>
        )

    [1] => stdClass Object
        (
            [title] => Aktualizacja
            [display] => hot_updated
            [align] => c
            [width] => 200
            [order] => 20
            [format] =>
        )

)

and I want to modify sligtly that data - but first I want to have the the code which will generate exacly result as above:
so for example with following code:
Code: Select all
$testarray = array(
'stdClass Object'=>
      array('title' => 'Hotele - Miejsce',
            'display' => 'hot_miejsce',
            'align' => 'l',
            'width' => 450,
            'order' => 10,
            'format' =>'' ,),

      array('title' => 'Aktualizacja',
            'display' => 'hot_updated',
            'align' => 'c',
            'width' => 200,
            'order' => 20,
            'format' =>'' ,),
);

I have following result:
Code: Select all
[0] : Array
(
    [stdClass Object] => Array
        (
            [title] => Hotele - Miejsce
            [display] => hot_miejsce
            [align] => l
            [width] => 450
            [order] => 10
            [format] =>
        )

    [0] => Array
        (
            [title] => Aktualizacja
            [display] => hot_updated
            [align] => c
            [width] => 200
            [order] => 20
            [format] =>
        )
)
Janusz
 
Posts: 194
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: PHP code modification

Postby kev1n » Mon Jun 10, 2019 3:31 pm

This is not a nuBuilder-specific question, maybe you could ask at stackoverflow. Normally you get answers there very quickly.
kev1n
 
Posts: 198
Joined: Mon Oct 15, 2018 2:13 am

Re: PHP code modification

Postby Janusz » Mon Jun 10, 2019 7:29 pm

Yes - you are right - the answer from stack overflow was immidiate.
I will remove soon this post not to spam this forum.
Janusz
 
Posts: 194
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: PHP code modification

Postby kev1n » Mon Jun 10, 2019 8:26 pm

Janusz wrote:Yes - you are right - the answer from stack overflow was immidiate.


:D :D
kev1n
 
Posts: 198
Joined: Mon Oct 15, 2018 2:13 am


Return to Custom Code



cron