Welcome Guest, Not a member yet? Register   Sign In
Template Library Version 1.4.1
#41

[eluser]Randy Casburn[/eluser]
Hi Colin,

While investigating this, I was running this through the trusty debugger. In the render() method at around line 585 through 589 where $output is on the receiving end of an assignment operator a couple of times? According to my debugger, it never really receives a value at that point. So when the conditional specifically at line 589 is followed, the return statement is supposed to return some output of the render() method always returns null. I'm not sure that was the expected behavior.

There is a problem with the way CI is rendering output for me at the moment, so maybe it is a configuration problem. If it is, I'll follow up so you can be on the look out for this odd behavior in the future.

This is SVN1.7.0.

Randy
#42

[eluser]Colin Williams[/eluser]
Here's what I hope to address with the next release of Template:

- Autoload Views in regions (might result in some other interesting features)
- Content “weighting” to sort written content. (This is related to your questions about order, Randy)
- Base-folder / theme-folder setting
- Better logging
- Possibly some profiling/debugging features

So, either all will come out at once in a 2.0 release or a few will come out here and there. Of course, if anything affects the API at all (and I really, really want to avoid that!), it will be a major version release. No promises on when. It's the holiday season and I've got more work than I can handle. In fact, a few of these items are functioning already, so no telling...

@adnan - Template is a CI library, so you can load it just like you load any other CI library. Autoloading won't really afford you anything extra. Not sure what problems you are facing. My hunch is that, if anything, it has to do with the recent class name change from "Template" to "CI_Template". It seems to work thus far, but it's not 100% proven. Try renaming the class and see if that doesn't help.

@randy - Thanks for debugging. I'll look into that line of logic. It probably has to do with encountering an "empty" region. And whatever issues crop up in SVN, to be perfectly candid, I'm going to ignore. I'll test it against official releases only. But I really appreciate the heads up.
#43

[eluser]Randy Casburn[/eluser]
[quote author="Colin Williams" date="1227533537"]
@randy - Thanks for debugging. I'll look into that line of logic. It probably has to do with encountering an "empty" region. And whatever issues crop up in SVN, to be perfectly candid, I'm going to ignore. I'll test it against official releases only. But I really appreciate the heads up.[/quote]

Fair 'nuf.
#44

[eluser]sankai[/eluser]
Hi,everybody.

I want to autoload default *.js or *.css

I always add follow code to __constructor in every controlls

Code:
$this->template->add_js('js/a.js');
$this->template->add_js('js/b.js');
$this->template->add_js('js/c.js');
$this->template->add_css('css/a.css');
$this->template->add_css('css/b.css');
$this->template->add_css('css/c.css');
It's very troublesome!! :gulp:

So I try to set it in Template config as:
Code:
$template['default']['regions'] = array(
    '_scripts' => array(
        'content' => array(
             '<script type="text/javascript" src="'.base_url().'js/a.js"></script>'
            .'<script type="text/javascript" src="'.base_url().'js/b.js"></script>'
            .'<script type="text/javascript" src="'.base_url().'js/c.js"></script>'
        )
    ),
    '_styles' => array(
        'content' => array(
             '<link type="text/css" href="'.base_url().'css/a.css" />'
            .'<link type="text/css" href="'.base_url().'css/b.css" />'
            .'<link type="text/css" href="'.base_url().'css/c.css" />'
        )
    )
  )
);

but it's so long and I can't use the function base_url() for the dynamic path in the Template config Confusedhut:

How to achieve autoload *.js or *.css ?

It may add new options for autoload js or css to the Template config in futrue?
#45

[eluser]Colin Williams[/eluser]
Just put the HTML tags in the main template. Any autoloading by the Template class wouldn't afford you anything.
#46

[eluser]OliverHR[/eluser]
Great library, work's great with CI 1.7 and XAJAX 0.5RC2. Are you planning support for pseudo-variables in future version's(for teamwork with developer-designers)?.
#47

[eluser]OliverHR[/eluser]
Collin

Can you post here or in your site, examples of how use the add_region() feature.


Thanks
#48

[eluser]sheldonnbbaker[/eluser]
Hi,

New to CI and this library of course. Everything is working out pretty good - but I'm simply trying to add another content region and it's not working.

I have these regions in config/template.php - top, header, content, footer, bottom.

I've added another one - 'chat' between 'top' and 'header'.

In my /index controller, I've added this:

Code:
$this->template->write_view('chat', "chat/box");

chat/box.php :

Code:
<div id="chat">

    CHAT ME UP

</div>

That code, however, is not appearing on my /index page - while every other one does (even removing ...write_view('header', 'index/header'); works fine - but the chat region does not show up.

It's grabbing the file correctly because I'm not getting an error saying that 'chat/box.php doesn't exist'.

Thanks for your help Smile
#49

[eluser]AgentPhoenix[/eluser]
Have you added the chat variable to the views/template.php file?
#50

[eluser]sheldonnbbaker[/eluser]
Ugh - no.

*feels stupid*

Thanks for the help. Smile




Theme © iAndrew 2016 - Forum software by © MyBB