Part of the EllisLab Network
   
1 of 2
1
Template Library Version 1.2
Posted: 03 August 2008 04:20 AM   [ Ignore ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

Template Library Version 1.2 has been released. Version 1.2 is an update to the Template class API and includes no bug fixes or new features.

——————————————————————————————————————————-

Visit the Template Library Homepage

View the Change Log

Still using Template 1.1? See the Ignited Code thread covering Template 1.1

——————————————————————————————————————————-

The Template library, written for the CodeIgniter PHP-framework, is a wrapper for CI’s View implementation. Template is a reaction to the numerous questions from the CI community regarding how one would display multiple views for one controller, and how to embed “views within views” in a standardized fashion. In addition, Template provides extra Views loading capabilities and shortcuts for including CSS, JavaScript, and other common elements in your final rendered HTML.

Using Template looks like this:

$this->template->write('title', 'Introduction to Template');
$this->template->write_view('content', 'blog/posts', $this->blog->get_posts());
$this->template->render();

Look interesting? Head over to the Template Library Homepage to begin using Template in your next CodeIgniter application.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 03 August 2008 05:36 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  2634
Joined  06-10-2007

Interesting to see that your template library works in almost the same fashion as my View Object (see signature) except the View Object can use arrays to specify the data and which view partials to load. In addition the View Object can also store other objects (libraries or modules) which may also render a view partial.

$this->view->data(array(    //load global data for the page
            
'title'    => 'Login::',
            
'username' => $this->validation->username,
            
'password' => '',
            
'checked'  => '',
            
'message'  => '<span class="err">'.$message.'</span>',
            
'action'   => site_url().'login/'.$path,
            
'lost_pwd' => site_url().'register/lost-pwd',
            
'catcode'  => 0,
        ));
        
        
$this->view->load(array(    //load the view partials
            
'header'    => 'header',
            
'menu'      =>  & $this->menu,    //the menu object will render its own partial
            
'content'   => 'login/form',
            
'footer'    => 'footer',
        ));
        
        
$this->view->render();

It looks like your originality is just a difference in class names.

 Signature 

URI Language Identifier | Modular Extensions - PHP5 | Modular Separation - PHP5 | Widget plugin | Access Control library

Profile
 
 
Posted: 03 August 2008 02:42 PM   [ Ignore ]   [ # 2 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

Yeah, wiredesignz, I came across your View Object library recently and wasn’t really surprised that these issues had been tackled before. Our approaches here are similar, but they do find their differences (and they’re easy to spot, especially in the workflow and implementation). Some members here noted that my load() method was a bit confusing, so I changed it to render(), which it turns out View Object uses too.

I think I took a different approach to documentation as well. Regardless, I intend to continue developing and supporting this contribution. I hope it helps some people, and that is all smile I would also encourage people to compare it to View Object and decide what works best for them.

It looks like your originality is just a difference in class names.

I would, again, stress that people look at both contributions and decide if this is an accurate assessment.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 05 August 2008 02:05 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  51
Joined  11-11-2006

@colin

first of all congratulations for this library, it really completes the CI toolset

from Template user guide:

While, yes, I could have come up with a unique, cutesy, silly name for Template, I feel such a move wouldn’t be very beneficial for those who use it

Please keep this name and don’t be tempted by funny and silly names.


@wirezdesign

It looks like your originality is just a difference in class names.

starting from elementary school we’ve been told that the same result may be achieved in several ways.
i just think that your innuendo is out of place (and time)

Profile
 
 
Posted: 05 August 2008 02:39 AM   [ Ignore ]   [ # 4 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

first of all congratulations for this library, it really completes the CI toolset

Thanks for those kind words, ralf57! I have certainly found it a nice addition on the several projects I have employed it (which is why I decided to clean it up, document it, and release it). I’m really glad some people are taking the time to read through the docs I prepared (spent more time on those than the code! No joke.)

I’ve been meaning to put together a screencast for the site to really draw some attention to the whole idea of Template, and some of the added features like cascading views, add_js and _css, using multiple template configs, etc.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 05 August 2008 03:07 AM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  51
Joined  11-11-2006
Colin Williams - 05 August 2008 02:39 AM

Thanks for those kind words

My words are sincere, you really deserve them since you’ve done a great job

Colin Williams - 05 August 2008 02:39 AM

I’m really glad some people are taking the time to read through the docs I prepared (spent more time on those than the code! No joke.)

I always start reading the docs, when they’re available and worth reading.
Template’s User guide adheres to CI guidelines and the result is clean and very useful.
I believe you’ve spent more time on docs than coding the library, that’s why most of the contributions come with scarse-to-no documentation.
Even in this field CI has pointed all of us in the right direction,; it’s up to us to follow the CI way…

Profile
 
 
Posted: 05 August 2008 03:14 AM   [ Ignore ]   [ # 6 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

I believe you’ve spent more time on docs than coding the library, that’s why most of the contributions come with scarse-to-no documentation.

I touched on this a bit in the Template 1.1 thread, but documentation is really a key part of the iterative process. When you sit down and focus on explaining your API, certain things come to light. Things you thought were clear on their own aren’t so clear. Shortcuts you took suddenly appear bad when supported by a list of caveats. New features expose themselves.

I would encourage all CI contributors to start on their documentation from the start—for them as producers as equally for us as consumers and users.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 05 August 2008 11:58 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  640
Joined  05-28-2008

good to see this.

A quick question: how did you make the documentation? It’s very much alike to the CI docs. Did you just recreate it, or is there some sort of cms/wiki behind it? Cuz I’m writing a library myself and thinking of publishing it. If/When I publish it, I’d love to create a similar documentation!

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

Profile
 
 
Posted: 05 August 2008 03:38 PM   [ Ignore ]   [ # 8 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

They give out the CSS needed to style it accordingly, so I started with that and obviously made some mods along the way. There is no CMS/wiki to drive it (sadly…). It’s just plain-old, hand-coded HTML files.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
Posted: 07 August 2008 10:37 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  640
Joined  05-28-2008

Aha, good to know!

Also, I just found out that’s it’s SUPER easy to add <script> tags in the <head> element so you can easily add little bits of javascript where you need them, but leave them out where you don’t…

All it needed for me was a better written template file.

I’m loving it!

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

Profile
 
 
Posted: 07 August 2008 02:42 PM   [ Ignore ]   [ # 10 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2916
Joined  07-27-2006

For advanced CSS, JavaScript, and other asset management, look into the AssetLibPro library. Also, Ocular is a library very similar to my Template (predates my Library by far, shame about the name though) that has some of the advanced asset inclusion features found in AssetLibPro.

 Signature 

Check out the Template Library
Oh yeah, I tweet, too (regarding CodeIgniter on occassion).

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120479 Total Logged-in Users: 18
Total Topics: 126554 Total Anonymous Users: 2
Total Replies: 665404 Total Guests: 311
Total Posts: 791958    
Members ( View Memberlist )