because this project may not be placed in the WEB root directory, it will be placed in a subdirectory, or the IP of the server may be modified frequently ( this project is open on both the extranet and the intranet, but the open URL of the extranet and the intranet is different, and it even makes a virtual directory, which is a bit strange ), so you can"t write it in the template
.I have tried variables such as script_filename,script_name,pathinfo,REQUEST_URI of $_ SERVER. After using pathinfo, they will also bring the information of pathinfo into it, causing them to use dirname to get the directory where these variables are located, and what they get is not the URL of the public directory where the real index.php is located
.and cannot be determined by judging the index.php in url, because it is possible that the server has also done URL rewriting, so the string index.php does not necessarily exist in URL and cannot be solved by string cutting.
if the current page is 192.168.1.1 static/js/ subDirindexindex.phpindexActionadminActionTest, then writing static/js/ directly in the template will be parsed to the 192.168.1.1/subDir/index.php/index/admin/test/static/js/ by the browser, so this method is not valid
is there any other way to get the URL path of the public/static static resource file?
I have tried to write _ _ STATIC__ or _ _ ROOT__, directly in the template. The results are all output as is in the direct browser