Welcome Guest, Not a member yet? Register   Sign In
About layout rendering
#11

[eluser]xwero[/eluser]
[quote author="beemr" date="1213095733"]Template Inheritance is definitely a nice helper, but once I got into it, I found it a mismatch for CI, considering the immediacy and flexibility of its native view loader. I still couldn't stomach loading a whole file just to add a couple of span tags and a whole other file just to close them. Yeesh.
[/quote]
I guess you don't really understand the helper? The idea is to make base templates and 'extend' those templates with custom data. So in your you would have a view file where you define a block and a child view holds the information for that block based on the block you defined.

if your site doesn't alter too much you only have to load 2 files instead of the 3 if you use the common header,content,footer approach.
#12

[eluser]beemr[/eluser]
Actually, I shouldn't have written those two sentences in the same paragraph (just edited it some :zip: ). I meant that even though I eventually went back to CI views, I still couldn't live with all of the extra files. No disrespect for Template Inheritance -- that's a great addition and proof of CI's breadth.

However, if you're interested, I've put up a wrapping function that has at least gotten me off of the ledge.
Here's the wiki: render
#13

[eluser]xwero[/eluser]
Inline tags around a blok tag are you insane Wink

Beemr i understand your idea but there is a big problem, for me at least, with the actual code. You have to put html in the controller. There are a few CI libraries that do it too but i stay away form them. But it's a personal preference.

But i see how your idea would be a good addition to the inheritance helper. The wrapping html could be the additional parameters for the startblock function. then you could do
Code:
&lt;?php startblock('content','<span class="bigbox"><span class="littlebox>','</span></span>') ?&gt;

edit : on second thought it wouldn't work because it only replaces the content between the block markers.
#14

[eluser]esra[/eluser]
The closest thing we've seen to what is needed was Coolfactor's proposed View library X3 for 1.5.x. Some of this functionality was incorporated into 1.6.x (better partial loading), but not the ability to have a separate View class which is subclassable. If this were the case, the View library could be extended to add the missing functionality. In retrospect, Coolfactor's View library was more like a document controller in the sense that it applied some controller-like qualities to views more akin to a truer MVC implementation like Mojavi or Symfony. Coolfactor's View library could be subclassed (XSLView, XHTMLView, HTMLView, WMLView, etc.), allowing better extensibility.




Theme © iAndrew 2016 - Forum software by © MyBB