Using Udemy Course, but with a little trouble
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Using Udemy Course, but with a little trouble
Hi, im making some use of the udemy course, and im stuck in the creation of a simple button via hooks, this is my code
AFAIK this should work but the Appgini App doesnt show the "Contrato" Button, it acts as nothing happened
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
if (isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
$j('#ep_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-success btn-lg" onclick="">' +
'<i class="glyphicon glyphicon-ok"></i> Contrato</button>' +
'</div>'
);
})
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
}
Any Tip? or if im doing some wrong?
Aldo
AFAIK this should work but the Appgini App doesnt show the "Contrato" Button, it acts as nothing happened
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
if (isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
$j('#ep_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-success btn-lg" onclick="">' +
'<i class="glyphicon glyphicon-ok"></i> Contrato</button>' +
'</div>'
);
})
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
}
Any Tip? or if im doing some wrong?
Aldo
Re: Using Udemy Course, but with a little trouble
Hi,
you need to add the code to the html.
Try after the ob_end_clean();
you need to add the code to the html.
Try after the ob_end_clean();
Code: Select all
$html.=$form_code;
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
Thanks for the quick reply! Im a C# coder, some quite basic/general html/php knowledge.
$html.=$nameofmy_formcode
im right?
Aldo
$html.=$nameofmy_formcode
im right?
Aldo
pböttcher wrote: ↑2022-01-18 06:52Hi,
you need to add the code to the html.
Try after the ob_end_clean();
Code: Select all
$html.=$form_code;
Re: Using Udemy Course, but with a little trouble
pböttcher's answer looks absolutely perfect.
Did you try? Doesn't it work? Is there any error message?
Code: Select all
$html .= $form_code;
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
It didnt for me: this is my piece of code, i placed the code (hopefully right) as you mention.
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
if (isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
$j('#ep_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-success btn-lg" onclick="">' +
'<i class="glyphicon glyphicon-ok"></i> Contrato</button>' +
'</div>'
);
})
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html.=$j;
}
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
if (isset($_REQUEST['dvprint_x'])) return;
ob_start(); ?>
<script>
$j(function(){
$j('#ep_dv_action_buttons .btn-toolbar').append(
'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
'<button type="button" class="btn btn-success btn-lg" onclick="">' +
'<i class="glyphicon glyphicon-ok"></i> Contrato</button>' +
'</div>'
);
})
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html.=$j;
}
jsetzer wrote: ↑2022-01-18 14:27pböttcher's answer looks absolutely perfect.Did you try? Doesn't it work? Is there any error message?Code: Select all
$html .= $form_code;
Re: Using Udemy Course, but with a little trouble
Did you really try with the code given to you? Your code is different, still. There is no declaration of PHP variable
Maybe you should start with a basic boilerplate and ensure you get this working before trying more complex ideas:
$j
and you are not appending contents of $form_code
PHP variable to $html
variable. Maybe you should start with a basic boilerplate and ensure you get this working before trying more complex ideas:
Code: Select all
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
ob_start();
?>
<script>
$j(document).ready(function() {
alert('hello world');
});
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html .= $form_code;
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
Nice, thanks, and you are right, im going to comment out and place a hello world first to ensure touching even the right files, come back in a couple of minutes.
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
To ensure im on the right direcotry I renamed main directory in the FTP and sends the expected error.
The end of the file in browser is: /ep_view.php so I guess im not barking to the wrong tree. Still nothing happens. Here is code
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
ob_start();
?>
<script>
$j(document).ready(function() {
alert('hello world');
});
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
}
The end of the file in browser is: /ep_view.php so I guess im not barking to the wrong tree. Still nothing happens. Here is code
function ep_dv($selectedID, $memberInfo, &$html, &$args) {
ob_start();
?>
<script>
$j(document).ready(function() {
alert('hello world');
});
</script>
<?php
$form_code = ob_get_contents();
ob_end_clean();
}
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
Im quite sure im missing some quite ovious...
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
I placed a snapshot here, maybe there is some weird thing going on
Image not appearing, here is a naked link http://www.edufione.edufisoft.com/share ... rror01.jpg
Image not appearing, here is a naked link http://www.edufione.edufisoft.com/share ... rror01.jpg
Last edited by arcanebits on 2022-01-18 17:15, edited 1 time in total.
Re: Using Udemy Course, but with a little trouble
You once again and still don't append
Your code:
It seems I am not able to help you. Maybe my English is not good enough, I'm sorry.
$form_code
to $html
variable, as we have already written a couple of times. It would be very helpful if you could just copy & paste exactly what we are giving to you.Your code:
Suggested code:<?php
$form_code = ob_get_contents();
ob_end_clean();
}
Code: Select all
<?php
$form_code = ob_get_contents();
ob_end_clean();
$html .= $form_code;
}
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Using Udemy Course, but with a little trouble
Your uploaded image is not visible - at least I cannot see it.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Using Udemy Course, but with a little trouble
Yes, maybe, but until we get to this unlikely case, for the moment you could just start by copying and then pasting the code given to you. This could become a game changer.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: Using Udemy Course, but with a little trouble
It worked!,
Sorry for my repeated mistakes, is not about your english, quite sure it was my issue, please keep the help comming.
Since I got the hello world working, I place the button now?
Thanks for you help!
Aldo
Sorry for my repeated mistakes, is not about your english, quite sure it was my issue, please keep the help comming.
Since I got the hello world working, I place the button now?
Thanks for you help!
Aldo