Welcome Guest, Not a member yet? Register   Sign In
Integrate Smarty Template Parsing into CodeIgniter
#11

[eluser]Jagar[/eluser]
I just looked at my header2.tpl file and I saw the following
Code:
<li><a >uri->segment(1) == ""} id="selected" {/if}
<a >uri->segment(1) == "about"} id="selected" {/if}

I will have to find another way to get this to work

Thanks
#12

[eluser]Aken[/eluser]
Jagar, perhaps you have a syntax / parse error in your template file. Check all your braces and such.

Also, if you're trying to use the CI super object in your template, I believe you need to use lowercase "ci". PHP variables are case-sensitive.
#13

[eluser]Makelaly[/eluser]
This is my first time i visit here. I found so many entertaining stuff in your post, nice to see that. especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up

the good work.

#14

[eluser]Jagar[/eluser]
While I have the site set to the the following...

Code:
define('ENVIRONMENT', 'development');

I am getting so many notices for any variables that has no value.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: variable_name

Filename: compiled/05c167972ba6cf610a299ccf7eb20dfc787e78c8.file.....php

Line Number: 45

I understand that I can set the environment to production, but I would like to get rid of any errors and notices rather than hiding them and was wondering if you have workaround these

Thank you again


Thank you
#15

[eluser]Aken[/eluser]
Those errors come from your code, not the template library. Chances are you are trying to use a variable in your template that you have not added to your view data array.
#16

[eluser]Jagar[/eluser]
Thanks again Aken, I have defined the variables and the errors are not coming back

Regards
#17

[eluser]Unknown[/eluser]
Hello Aken,

Thank you for creating this CI-Smarty integration.

I had to change MY_Loader.php because syntax errors were not showing.
The end of MY_Loader.php now contains:
Code:
try {
$output = $CI->smartytpl->fetch($template);

// Return the output if the return value is TRUE.
if ($return === true) return $output;

// Otherwise append to output just like a view.
$CI->output->append_output($output);
} catch(Exception $e) {
show_error($e->getMessage());
}
and now Smarty syntax errors are showing.

Is this the right way to do this? Can you change it in the git-repository, or should I do a pull-request?

Kind regards,
Hendrik
#18

[eluser]Aken[/eluser]
I'll have to look into that. I never ran into Smarty syntax errors, so I'll check into what kind of errors Smarty throws and how to integrate them into CI. Thanks for the heads up.
#19

[eluser]Aken[/eluser]
I've updated this script today; details are on the first page of this thread or on Github. Smile
#20

[eluser]Unknown[/eluser]
hi, i am trying to close caching but i cant. How can i do that?




Theme © iAndrew 2016 - Forum software by © MyBB