Need help with Template/Cache Libraries that I wrote... |
[eluser]mlage[/eluser]
Hello everyone! I wanted to write a nifty template/cache engine for this framework (and of course, my personal use) and I have finished writing the first version of the code but every time I try to use it, I get blank pages sent to me without any PHP errors. I have checked the configuration, PHP errors are set on. I'm running Apache2, PHP 5, the latest of most modules on an Apache Server on my personal Ubuntu machine at home... Full Documentation and source code viewable here: My Online Documentation I have setup in the main config that personal libraries are "LAGE_". Session and the appropriate libraries in use are auto-loaded... I just don't get why I don't get errors from PHP... just a blank page... I was hoping someone with a fresh perspective could see what I easily did wrong and lead me in the right direction for debugging... An example of the controller that gives me a blank page: Code: class Test extends Controller { File Structure: LageCMS/index.php LageCMS/system/application/libraries/ the two libraries LageCMS/system/application/controllers/test.php LageCMS/system/gh/ skeleton.html and all necessary views (footer.html, head.html, mainNav.html) Does anyone know for some debugging techniques in CI? Like if I can setup "break" points with a debug class or something to analyze the data as it flows through the program? Any help is greatly appreciated!!!!
[eluser]WanWizard[/eluser]
Are you sure error reporting is set to E_ALL, and display errors is on in php.ini? Because you're using $CI in your index method, which isn't defined anywhere, and therefore a PHP error that should have been displayed.
[eluser]mlage[/eluser]
@WamWizard: Thank you!! I had to update the php.ini settings and now I'm getting errors ![]() ![]() Right now its setup so that only views in the "skeleton" can have sub-views... but we both know that a recursive solution could easily do infinite views in a tree like structure ![]() I'll post an update to the code when I get it working ![]() THANK YOU!!!! P.S. Fixed the reference to the undefined $CI object...woopsies... I was to caught up in programming in the library that I forgot that the controller's $this reference was all I needed... P.S.S. I love your avatar... HAHAHA
[eluser]mlage[/eluser]
Okay. I have gone through the code and rewritten a good chunk. Fixed all php errors and some logic errors. I decided to change the makeTemplate() method into two methods. There is still the makeTemplate() method but now, inside it, I call recursiveParse() method. Here lies my problem... it isn't working very well. I finished rewriting my comments to work with a phpdocument parser ... so here is the documentation and source code: My Online Documentation Again, the two links I provided in my first post of this thread to the actual code files have been updated to reflect my changes if you want to read the whole updated code... Folder of the skeleton file and other view files Error: Nothing is outputted So if anyone knows about tokens [strtok()], and recursion and has some time, can you please give a look over the code... Here is the call in the makeTemplate() function: Code: $token = strtok( $skeleton, "{" ); //<!DOC...xhtml"> Code: function recursiveParse ( $token, $tmp ) { Code: class Test extends Controller { ![]() Update: Added link to my documentation to help others who are interested in helping me ![]() |
Welcome Guest, Not a member yet? Register Sign In |