CI goes crazy with iframes |
Hi,
I was trying to embed youtube videos into my website. When CI encounters an iframe tag on the page it throws a whole load of errors basically going through my model class and finding an error with every method. My model class is working fine. This is very unusual, I have no idea where the errors are coming from. Even when the iframe is not in a PHP block the output at any iframe is a bunch of erroneous error messages. Does anyone know what is going on here? I believe I am using CI version 3. Here is the code for my partial view: Code: <section> This is the error that is shown when this view is displayed Code: A PHP Error was encountered
Severity: Notice
Message: Trying to get the property 'section' of non-object Filename: models/CourseModel.php Line Number: 47 Don't you see here that there is an issue Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
(02-25-2024, 10:26 PM)luckmoshy Wrote: Severity: Notice Hi thanks for the reply. My issue is that if I have this code: Code: <section> As soon as I change this to: Code: <section> CodeIgniter throws up the error messages. Why would it even check/run my data model when all I am doing is inserting HTML code? The data model code is working fine elsewhere in my project so there is no issue with that. Thanks
Why not try using CodeIgniter 4 html_helper -> video which embeds videos.
HTML Helper - video What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Without calling any model, the following code works fine in my local 4.4.6:
Code: <section>
I am using CI 3.1.0 so cannot use CI 4 libraries (I assume).
Is there a configuration setting anywhere in CI 3.1 that prevents certain HTML elements from being used? This is the only thing that I can think of. Many thanks
I tried my code on a local Codeigniter 3.1 site, still no problems. It displays just fine.
I even tried calling the iframe as a sub-page with the following code: Code: <!-- Main content -->
(02-27-2024, 08:01 AM)JustJohnQ Wrote: I tried my code on a local Codeigniter 3.1 site, still no problems. It displays just fine. Yes it should just work. That is why I am wondering if there is some configuration setting that prevents the html tag iframe from working on my server. Thanks for your feedback.
Go back to the basics. Remove all references to a model and see if you can get the iframe to work with something like the code I provided. It pretty much looks like a typo somewhere but without full code it's hard to tell. Also check your page source with F12 (in most, if not all, browsers) to see if there are any irregularities.
Fixed it.
Just run the code on a browser that is not Firefox. Is there any CI/PHP code that I can use to check what browser is being used? |
Welcome Guest, Not a member yet? Register Sign In |