-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Precompile templates error with filter. #21
Comments
Thank you! When not trying to precompile templates but viewing your application in the browser, as usual, the filter works, doesn’t it? So it’s really not that something is wrong with the filter or the way you defined it. I guess this must then be because the filter is not yet defined when the framework precompiles the templates for you. That step is executed in the What you did is correct, the problem is in this framework. You could temporarily move your filter definition to the |
Thank you for your fast reply! Yes in the application the filter work and I suspected that the precompile was called before but I didn't check where exactly thanks for your link to show me where. By the way I'll wait your fix because not just need to move the filter in parent but the class init should be moved too so the index.php in child directory become senseless. |
Not sure if you should really wait for a fix, because we cannot give any time estimate right now. Are you sure you really need to move all your definitions and classes? You should make your classes compatible with autoload. If you do this, it’s not important where your classes are loaded first. Any class in As for this issue here, I see two possible solutions:
|
Thanks! I'll try to read well and understand your 2 solutions and make some test hope that I fix because I didn't get what do you mean with
I just split classes because the app is big but I think that I followed your directive How To manage the Route and Class definition. app/index.php
app/routes/backend.php
app/controllers/backend/core/dashboard.php
Now even if I add filter function on top of index.php show me the error because the template precompiled is before in parent index.php so where is my different declaration ?
|
Your code looks good. Look into the Lines 106 to 108 in 42ee0cf
Right there, in line 107, simply insert require __DIR__ . '/app/global.php'; and then create a new Now move the definition of the filter from Does that work? |
Sorry for long the delay of my answer, but I was working on other part. For make this test is not so much fast and simple because I don't have only 1 filter but different Filter, function and Global. Than I should to change some constants. If this is the final solution and this is the only way so I'll change all the structure. Thanks. |
Anyway as a temp test I initialized everything before and work. |
Thanks, good to know! Unfortunately, this is still the only two solutions I can imagine:
As I have explained the second solution already, let’s talk about the first solution and what you’d need to do: In |
I try some test but I don't understand why is generated this error.
I created this filter after issue #14 my problem was to check if a lang file exist if not use a fallback file. Because is in Template I prefered to use this solution and not file exist for directory traversal attacks.
MY FILTER
The if condition in template where is indicated the error
Seems that doesn't like this syntax
{% if qb_lang | ifFileExist %} (Line 16)
Thanks.
The text was updated successfully, but these errors were encountered: