Welcome Guest, Not a member yet? Register   Sign In
[Library] Simple Dwoo implementation
#2

[eluser]Enorog[/eluser]
Thank you, this is a much better implementation indeed.

I've been using a simple extended parser so far (I think that was yours as well - you could trigger a helper function with parameters inside curly quotes, but I would like something full featured now (with conditionals for instance).

I do have a question (and perhaps a helpful way on how to organize your parsing). This is how I've got things set up now:

Controller
(calls model, fills $page_info array with stuff, then parses the view like this)
Code:
// PARSE VIEW FOR CMS PLUGINS
$this->parser->parse('page_view', $page_info);

Main view (page_view)
Code:
<?php $this->load->view('page/header'); ?>
<?php if ($view == 'edit') { $this->load->view('page/content_admin'); } ?>
<?php $this->load->view('page/content'); ?>
<?php $this->load->view('page/footer'); ?>

Inside "page/content" view, there is a html string coming from database (stored in $page_info['content'] and inside this html, I call a helper with this parse-ready string
Code:
{helpername:prepare_gallery('folder_name')}


I've done benchmarking for this nested-view approach and I don't see a problem with it, but I'd still be interested if I'm breaking any rules here (output buffering wise). Especially if I parse the whole nested-view thing.

My main question is - should I go to Dwoo if I want more options in my {parser calls}? I wouldn't have to change my controllers, since I already use the parser to call my view, right?


Messages In This Thread
[Library] Simple Dwoo implementation - by El Forum - 11-15-2009, 10:11 AM
[Library] Simple Dwoo implementation - by El Forum - 11-17-2009, 07:50 AM
[Library] Simple Dwoo implementation - by El Forum - 11-17-2009, 08:07 AM
[Library] Simple Dwoo implementation - by El Forum - 11-23-2009, 04:19 PM
[Library] Simple Dwoo implementation - by El Forum - 11-28-2009, 05:21 AM
[Library] Simple Dwoo implementation - by El Forum - 11-28-2009, 07:51 AM
[Library] Simple Dwoo implementation - by El Forum - 11-28-2009, 09:31 AM
[Library] Simple Dwoo implementation - by El Forum - 04-14-2010, 01:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB