Forums

CFv6 - General problem

HerKle 12 Jan, 2018
I am working with CFv5 and am more than satisfied. Now I used a train ride (without wifi) of eight hours to study CFv6 and its tutorial and exmperimenting a bit locally – but I didn't even manage to show data read out from a database! I am irritated: have I become complete ignorant or is the tutorial not tutoring? :-;

The tutorial says if I don't know how the variable looks like, put {var.pr:read_data1} into a custom field. The result shown in preview is: {var.pr:read_data1}.

I tried ordinary php and asked
echo var_dump($this->data['read_data1']);
. What I got was: NULL.

But the debugger says there are data:
Array
(
    [read_data1] => Array
        (
            [log] => Array
                (
                    [0] => SELECT `jubi`.`id` AS `jubi.id`, `jubi`.`name` AS `jubi.name`, `jubi`.`gdat` AS `jubi.gdat` FROM `gk16_filialfinder_stores` AS `jubi` WHERE `jubi`.`gdat` > '0';
                )

            [var] => Array
                (
                    [0] => Array
                        (
                            [jubi] => Array
                                (
                                    [id] => 1
                                    [name] => Weggefährten
                                    [gdat] => 08.10.1954
                                )


I need to process those data before I present the results in "Display Section". So I need to know eg. how to reach [gdat].

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On page 21 you use "Content" as model name. A really bad choice of name. When I was searching for "php syntax" I was shown page 26 with some explanation containing "content" which I misunderstood as some necessary function – without knowing the preconditions of page 21. I suggest you use for customizing examples in tutorials sth. like "mymodelname".

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks for your assistance!
NickOg 14 Jan, 2018
I found conversion from CF5 to CF6 not easy but well worth while - in the end! 🙂 To the degree that it is worth my while to rewrite some CF5 forms in CF6.

Have you tried
dump($this) 
to see that the data is there as you expect? And Max passed this on as a means of retrieving data
$mydata=$this->get('read_data1');


Stick with it. :twisted: :twisted:

Regards
Nick
HerKle 14 Jan, 2018
The last one did it! Thank you so much!

Could someone write it into the tutorial, too? Thx!
This topic is locked and no more replies can be posted.