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

[eluser]Tominator[/eluser]
It's logged to log as error. In new version I add more hints to log, and add show_error() when template file doesn't exists.

Your code: I going to try this, because it should work.
#12

[eluser]Tominator[/eluser]
It works great, I've made a video (of my testing):
http://other.comper.sk/CI_CTP.avi
#13

[eluser]Ahmad Ibrahim[/eluser]
[quote author="Tominator" date="1274222669"]It works great, I've made a video (of my testing):
http://other.comper.sk/CI_CTP.avi[/quote]

The issue happened because I have my application directory outside system directory

modify your library by replacing lines 109,110 by the following :

Code:
$this->file = APPPATH . 'views/' . $this->theme . $template . '.' . $this->extension;
$this->folder = APPPATH . 'views/' . $this->theme_Original;

your parser is amazing.. Smile

Regards.
#14

[eluser]Tominator[/eluser]
Thanks for feedback.

There's just one problem with these lines: images in localhost.

Their link is (by using APPPATH): 'D:/www/test/...'
But it's have to be: 'file://D:/www/test/...'

So I force them "localhost" link: 'http://localhost/test/...' (I hope it was meaningful sentence).

I'll try to fix it somehow Big Grin
#15

[eluser]Ahmad Ibrahim[/eluser]
Good point..

I added new configurtion option in config.php $config['views_folder_url'], by adding theme name to it everything is working fine..

can you add some functions to handle css and js like placing <%CSS%> tag in header which is replaced by css files links and same for js files ?

aslo can you provide a proper way for handling language and configs, something like {langConfusedomething} or {config:base_url} ?
#16

[eluser]Tominator[/eluser]
[quote author="Ahmad Ibrahim" date="1274230321"]Good point..

I added new configurtion option in config.php $config['views_folder_url'], by adding theme name to it everything is working fine..

can you add some functions to handle css and js like placing <%CSS%> tag in header which is replaced by css files links and same for js files ?
[/quote]
Can you tell me some advantage? Cause you can still use {css}, or cycles (I think absolutly great solution):
Code:
&lt;!-- BEGIN css --&gt;
&lt;link rel="stylesheet" type="text/css" href="{file_name}.css"&gt;
&lt;!-- END css --&gt;
But if you don't like it, I can make <%CSS%>.
[quote author="Ahmad Ibrahim" date="1274230321"]
aslo can you provide a proper way for handling language and configs, something like {langConfusedomething} or {config:base_url} ?[/quote]
Good Point!
#17

[eluser]Ahmad Ibrahim[/eluser]
Good solution..

Sorry for my many demands Big Grin I'm not expert in php, my main tool is .net so I can't made this modifications myseflt..

can you make something like helpers folder containing files with functions to extend parser like date and time formatting or forms builder, and I can load these helpers by

Code:
$config['comper_parser']['helpers'] = array('DateTime','Forms');

or automatically load it from template by something like

Code:
{HelperName->FunctionName:parameter1, parameter2,parameter3...}

I think this feature will help your parser as php template engine not only codeigniter parser,
#18

[eluser]Tominator[/eluser]
I don't think it's a great idea. Because it will make parser robust, and the main advantage is simplicity. It means: parser is super easy to understand and super easy to use (or should be Big Grin). So if you want something really robusts can get for example smarty Big Grin I like 'light-weight' solutions, that's why I chose CodeIgniter.
#19

[eluser]Ahmad Ibrahim[/eluser]
but what if I need to check if there is any item in the array before using cycle ? is there any built-in function to perform this task ? and how to use arithmetic operators in IF condition ?

I don't it's a bad idea top provide an option to extend the parser, additional functions will be loaded when it is called..

Regards..
#20

[eluser]Tominator[/eluser]
As you can see, I was really thinking about that.

You said: "but what if I need to check if there is any item in the array before using cycle ?"
Answer: If you make cycle in your TPL file, but not in PHP, cycle will be automatically deleted (because there are no data which would be cycling).

You said: "and how to use arithmetic operators in IF condition ?"
Answer: Give me real example of using this - where would you use it? I think you really don't need it - and if really need it, I'll give you a solution.

You said: "I don’t it’s a bad idea top provide an option to extend the parser, additional functions will be loaded when it is called.."
Answer: It may be fine, but how will I implement it? Where in the script? Because you would like to add additional functions in different parts of parser. Somebody would like to extend Conditions and somebody Outputing.

Tom.




Theme © iAndrew 2016 - Forum software by © MyBB