Libraries Extending Question |
I have a Parsedown.php file in my libraries folder
application > libraries > Parsedown.php PHP Code: class Parsedown And I want to extend it application > libraries > MY_Parsedown.php I tried require but did not make the new changes. How can I extend a library from with in application library and not system libraries. How can I extend the parsedown into MY_Parsedown.php PHP Code: <?php
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
The "MY_" convention you use is the intended convention for extending CodeIgniter's core libraries. You are misusing it. See https://www.codeigniter.com/user_guide/g...core-class
The approach might be reasonable, with slightly different naming. You could make your class "Custom_parsedown", and start it with Code: require APPPATH . 'libraries/Parsedown.php';
(01-12-2017, 08:25 AM)ciadmin Wrote: The "MY_" convention you use is the intended convention for extending CodeIgniter's core libraries. You are misusing it. See https://www.codeigniter.com/user_guide/g...core-class I made it work I have had to put the parsedown library in system library folder and the use MY_Parsedown.php
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(01-12-2017, 01:19 PM)wolfgang1983 Wrote:(01-12-2017, 08:25 AM)ciadmin Wrote: The "MY_" convention you use is the intended convention for extending CodeIgniter's core libraries. You are misusing it. See https://www.codeigniter.com/user_guide/g...core-class That would be the wrong thing to do, because if somebody upgrades CodeIgniter and doesn't know that the parsedown library needs to be saved, they'd generally replace the whole system directory and wipe it out. You should just put your extension and parsedown libraries in the application/libraries directory, and do something like this: PHP Code: <?php
(01-12-2017, 02:21 PM)ciadmin Wrote: @skunkbad ... aren't we saying the same thing? Need to extend the library though I am going to have to put the parsedown library in system libraryes folder This way below is not what I am after Code: require_once(APPPATH . 'libraries/parsedown.php');
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(01-12-2017, 02:21 PM)ciadmin Wrote: @skunkbad ... aren't we saying the same thing? We are, but OP is placing the library in the system/libraries directory, so my comment was necessary to reinforce doing things the right way. (01-12-2017, 03:19 PM)wolfgang1983 Wrote:(01-12-2017, 02:21 PM)ciadmin Wrote: @skunkbad ... aren't we saying the same thing? If you're not after doing things the right way, then why ask for help or advice? |
Welcome Guest, Not a member yet? Register Sign In |