As about language.php file I said above, do you suggest any better way to handle language?
The Symfony2 Translation Component.
If you have decided to work with this framework, keep in mind that it implements a lot of great stuff to build a strong web appâ.
@scoolnico Thanks.
Someone please help for this or this. I am stuck. I am not sure if this is a bug, may be I should still change something else too?
PS.
@swader Do you have any idea?
@nimasdj donât use global constants and your problems are solved.
Ok. I donât use global constants for language any more. But that css background image problem has nothing to do with constants and I donât use constants either. May you please kindly help for that css issue as I am stuck?
@swader
@Jeff_Mott Do you have any idea for problem above?
Youâre taking an entirely wrong approach to the whole matter and itâs confusing to understand, sorry. You shouldnât be developing applications in such a way, and you should never ever try to âsecureâ an app with .htaccess files.
Do you mran I have to install app directly in main website folder, public_html, that /src/,/app/ will be in upper level folder outside of public, instead of installing it in a folder like http://www.mysite.com/symfony that other folders would be still in public folder?
Anyway if i want to do so, why css images are broken?
@swader
Ditto everything swader has said.
Global constants are the kind of code you want to move away from. Symfony is built so that everything is local, dependency injected, and decoupled.
If youâre trying to do language translation, then read up on how Symfony does translations.
For your CSS problem, only the web/ folder is supposed to be in the web serverâs document root. Donât treat the project root as if it were the web root.
And more generally, try to start using these tools in the way they were designed to be used. You keep running into problems because you keep trying to do weird and unusual things.
Ok. Iâd go with your and swaderâs advicrs. But assuming symfony web root is http://www.example.com/symfony and other /app/, /src/ folders should be moved two folder levels upper rather one level, to place them out of public. So just changing kernel and loader path in app.php is enough to call them from two folder levels upper rather than one? Or any other changes are still needed?
No I wouldnât do that either. I would use Apacheâs Alias directive.
Alias /symfony /path/to/symfony/web
<Directory "/path/to/symfony/web">
AllowOverride All
Allow from All
</Directory>
@jeff_mott What does it do? Does it redirect http://www.example.com/app and http://www.example.com/src to http://www.example.com/symfony? right?
Why not just disallowing access to them with .htaccess?
If I want to re-distribute my app to others I have to tell them to edit this apache with correct path? Isnât it an easier way? isnât it better to move app.php to root and secure other folders with htaccess?
even if I want to move other folders two levels upper to place them outside of public, there should be a write_to config to let it know where to install assets, but it seems there is a bug that assets:install does not recognize write_to cofig for âbundlesâ and only dumping assets will be created in write_to location. I reported this bug to them but I was completely ignored. Only this current structure works properly OR it should be installed certainly in main root folder directly that other folders would be outside of public.
It seems I am just wasting my time with symfony as its assets is very buggy and has problems when you want either to move app.php to root or move other folders two levels upper, or which way do you go to make it more user-friendly for your end-users if you want to distribute your app?
@Jeff_Mott going with your and @swaderâs advice, if my symfony /web/ folder is http://www.example.com/symfony/ then how to secure other folders like: http://www.example.com/src/ and http://www.example.com/app ? I did not understand, please clarify.
@swader If I should not secure http://www.example.com/app and http://www.example.com/src with htaccess then how should I secure them to have its /web/ folder as redirect http://www.example.com/symfony? As I said its assetic is buggy if changing its current structure. what do you advice?
@Jeff_Mott
Sorry, did not understand how to use it. assuming all /web/, /app/ and /src/ are in /symfony/ folder, where should I place that htaccess? in /symfony/ folder itself? and it should be like this?
Alias /symfony /symfony/web
<Directory "/symfony/web">
AllowOverride All
Allow from All
</Directory>
I got 500 error for this. please advice.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.