Problem with load->helper |
[eluser]frizbee[/eluser]
Hey everyone, I have problem with loading helpers. Here is what i have but in not load. Code: public function __constract() Code: echo doctype('html5'); I found that all tutorials on youtube and official website is based on 1.7 version and it's totally different from 2.0.2 Almost everything what i do, is not working.
[eluser]WanWizard[/eluser]
And what happens if you do this? Any error messages? If it doesn't echo as expected, what does it echo? We can't help you when the problem is described simply as "not working"...
[eluser]InsiteFX[/eluser]
And if you expect to see it echoed to the screen you are wrong! You need to view the html souce to see it... Code: <?php echo doctype('html5');?> Seems like a lot work just to write: Code: <!DOCTYPE html> InsiteFX
[eluser]frizbee[/eluser]
I found error. I have to load helpers in config.php Code: $autoload['helper'] = array('url','html','form'); And I don't need them to load in Controller (blog.php) file Code: $this->load->helper('html'); It's not shown in tutorials and manuals even on official website. In 2.0.2 manuals it sais: Code: Loading a Helper
[eluser]InsiteFX[/eluser]
Oh Really then what is this? Auto-loading Helpers If you find that you need a particular helper globally throughout your application, you can tell CodeIgniter to auto-load it during system initialization. This is done by opening the application/config/autoload.php file and adding the helper to the autoload array. InsiteFX
[eluser]cideveloper[/eluser]
If you just copied and pasted the code you showed then the problem is "constract". It is not "constract" it is "construct"
[eluser]frizbee[/eluser]
Thank you everyone it's working now. I will study CI further |
Welcome Guest, Not a member yet? Register Sign In |