Welcome Guest, Not a member yet? Register   Sign In
[1.5.1 RELEASED] COMPER Template Parser
#1

[eluser]Tominator[/eluser]
Hello,

let me introduce you, in my opinion (yes, I'm author), the best parser for CI:

COMPER Template Parser

Actual version: 1.5.1

Why is it best?
1. It's absolutely simple!
2. It's free for commercial and non-commercial projects!
3. It's using Output class, so you can caching!
4. It's supporting pseudo-variables, cycles (dynamically nested too), conditions and including!
5. Providing theme support - solution for your css/js/img files (you can make thousands of themes for your web)!
6. It's just ONE file!
7. Only two methods!
8. With support and docs (of course)!

Why it's better than default?

1. Better system of pseudo-variables replacement
2. Supports conditions, cycles and includes

Why it's better than another parsers?

1. Supports conditions, cycles and includes
2. Simplicity - just 3 methods (1 required), customizable, and just one file

Links:
Homepage | Download | Docs | Licence | Changelog


Examples:
Example (without theming and parameters):
Code:
$this->load->library('parser');

$this->parse('my_template');

Example 2 (with theming, without parameters):
Code:
$this->load->library('parser');

$this->parser->theme('default');
$this->parser->parse('my_template');

Examples with parameters are in docs.

Use it!
#2

[eluser]PoetaWD[/eluser]
This is reaaaallllyyy cool !!!

I might give it a TRY !

I was looking for a template parser like this for a while !

Thanks !
#3

[eluser]Tominator[/eluser]
I'm testing right new version 1.3.1, which is even more simpler and smarter!

Just 3 parameters (template name, data, config)!
Support multiple applications!
No spacing limits and case-intensive statements!
English comments!

You'll get absolutely freedom - coming soon!

(I'm waiting for your feedbacks too!)

Tominator
#4

[eluser]Tominator[/eluser]
Version 1.3.1 released.

What's new:
1. 3 parameters in parse method
2. Support multiple applications
3. No spacing limits and case-sensitive statements
4. Supports global configuration
5. Support for Benchmarking class
6. You can set your type of template files
7. You can set exceptions for parsing
8. You can set theme by $config too

I have rewritten docs, but my English is poor, so if you find some mistakes there, write me please.

First post edited! I'm still waiting for your feedbacks!

Tominator
#5

[eluser]Tominator[/eluser]
60+ downloads and no feedback Sad
#6

[eluser]Ahmad Ibrahim[/eluser]
I tried it but the result was blank page..
#7

[eluser]Phil Sturgeon[/eluser]
This doesn't seem to offer anything that can't be done with the combination of my Template and Dwoo libraries and is missing rather a lot of features.

What is the advantage?
#8

[eluser]Tominator[/eluser]
Phil Sturgeon:
1. Conditions: Dwoo supports if/else statements, my supports if/elseif/else statements
2. Implementation: It's simple to implement - just 2 methods, but one required (if you don't want to use themimg you don't have to)
3. No-PHP: I don't like mix: PHP and HTML together. So, if you use my parser, you will write clean HTML not PHP.
4. Solution for img/js/css files + quick access to them (without setting something in PHP)
5. Better system for cycles then builded CI parser, because you can use the same pseudo-variables for cycles and whole template.

[edited]: What features are missing? I have no idea, what to implement, so you can give me some tips.

Ahmad Ibrahim [edited]: I was thinkg for a while, about your problem. I've got question: what extension does your template file use? If it's .php you have to change value 'extension' in $config (third parameter) to 'php'. If you are using .tpl, please post your code here.

Bugs founded:
Including with changed extension not working properly.

News:
I'm working on version for CI 2.0.

Tom.
#9

[eluser]Ahmad Ibrahim[/eluser]
controller function :

Code:
function sample()
    {
        $this->load->library('parser');
        $this->parser->parse('sample');
    }

template views/sample.tpl
Code:
<html>
<head>
<title>Testing</title>
</head>
<body>
Static Content
</body>
</html>
#10

[eluser]Ahmad Ibrahim[/eluser]
even if I use template that doesn't exist it never gives me any thing but blank page no errors or any thing




Theme © iAndrew 2016 - Forum software by © MyBB