Welcome Guest, Not a member yet? Register   Sign In
Really Simple Smarty 3 Library for Codeigniter
#21

[eluser]Vheissu[/eluser]
The issue us with the variable you're passing. Instead of storing results in $data, try going: $data['data']; then you should be able to access a var called data in your templates.
#22

[eluser]Sazan[/eluser]
[quote author="Vheissu" date="1303955450"]The issue us with the variable you're passing. Instead of storing results in $data, try going: $data['data']; then you should be able to access a var called data in your templates.[/quote]

Not working. Sad Tried different variations with no luck...
Btw, if there is any error with or within template why it doesn't show any errors? Just a blank screen.

I wish you had some free time to revise your great lib and fix these bugs:

1. passing model results directly to the template is impossible now (which is essential functionality, as it's very common need to build simple lists from the databases)

2. no error handling/logging when something is wrong with/within templates. (if you forgot to put $ before the variable in tmpl like {var} you just won't see anything, just a blank screen)
#23

[eluser]Vheissu[/eluser]
[quote author="Sazan" date="1303989094"][quote author="Vheissu" date="1303955450"]The issue us with the variable you're passing. Instead of storing results in $data, try going: $data['data']; then you should be able to access a var called data in your templates.[/quote]

Not working. Sad Tried different variations with no luck...
Btw, if there is any error with or within template why it doesn't show any errors? Just a blank screen.

I wish you had some free time to revise your great lib and fix these bugs:

1. passing model results directly to the template is impossible now (which is essential functionality, as it's very common need to build simple lists from the databases)

2. no error handling/logging when something is wrong with/within templates. (if you forgot to put $ before the variable in tmpl like {var} you just won't see anything, just a blank screen)[/quote]

The code does have its flaws. I'll probably get around to revising the code this long weekend we have in Australia. I have another library called Plenty Parser which allows Smarty view rendering as well, so it would be beneficial to that as well.

The error supressing is due to the fact if you're checking in your views for a variable that isn't defined, it'll throw a variable doesn't exist error. {if $testvar} if $testvar isn't defined, previously it would have thrown an error.
#24

[eluser]irrg[/eluser]
Just tried wiring this up, and got

Fatal error: Cannot access protected property CI_Loader::$_ci_cached_vars in /Projects/foo/application/libraries/MY_Parser.php on line 39

Is this because of a recent edit?
#25

[eluser]darrentaytay[/eluser]
I came across this problem also and found out that it's because in the latest version of Codeigniter Reactor, the $_ci_cached_vars variable has been made protected.

In systems/core/Loader.php:
Code:
protected $_ci_cached_vars        = array();

I never recommend changing the core but in order to get that worked, you will either need to change the above line to make it public:

Code:
public $_ci_cached_vars        = array();

Or modify the Smarty Library like so:

MY_Parser.php

Remove the following lines of code:

Code:
// Merge in any cached variables with our supplied variables
        if (is_array($data))
        {
            $data = array_merge($data, $this->CI->load->_ci_cached_vars);
        }
#26

[eluser]irrg[/eluser]
I'd rather not mod core since I plan on doing hg pull updates. thanks. Curious why they switched that to protected.
#27

[eluser]Vheissu[/eluser]
Just pushed a solution just then. Removed the cached vars functionality for the time being due to the fact that the cached vars variable was made protected for some f*cked up reason, I wonder who made that stupid decision to change it?

We could perhaps fix it by extending the loader using a MY_Loader and then make it a public variable again. Or perhaps we should just log a ticket as it might have been an error on the Reactor teams part.

**Update**

Created a bug ticket: https://bitbucket.org/ellislab/codeignit...ystem-core
#28

[eluser]irrg[/eluser]
no clue, that is pretty damn stupid.

By the by, not having the permissions right on the cache folder makes smarty fail quietly. kind of annoying.
#29

[eluser]irrg[/eluser]
[quote author="Vheissu" date="1304927121"]Just pushed a solution just then. Removed the cached vars functionality for the time being due to the fact that the cached vars variable was made protected for some f*cked up reason, I wonder who made that stupid decision to change it?

We could perhaps fix it by extending the loader using a MY_Loader and then make it a public variable again. Or perhaps we should just log a ticket as it might have been an error on the Reactor teams part.

**Update**

Created a bug ticket: https://bitbucket.org/ellislab/codeignit...ystem-core[/quote]

am i really dense today or did you not push your solution? the last commit is about adding comments.
#30

[eluser]Vheissu[/eluser]
[quote author="irrg" date="1304932278"][quote author="Vheissu" date="1304927121"]Just pushed a solution just then. Removed the cached vars functionality for the time being due to the fact that the cached vars variable was made protected for some f*cked up reason, I wonder who made that stupid decision to change it?

We could perhaps fix it by extending the loader using a MY_Loader and then make it a public variable again. Or perhaps we should just log a ticket as it might have been an error on the Reactor teams part.

**Update**

Created a bug ticket: https://bitbucket.org/ellislab/codeignit...ystem-core[/quote]

am i really dense today or did you not push your solution? the last commit is about adding comments.[/quote]

My last push contained a few commits. But a commit relating to the cached vars fix was made though: https://github.com/Vheissu/Ci-Smarty/com...e914170968




Theme © iAndrew 2016 - Forum software by © MyBB