Yii error load css when using manage url - yii

I have folder resource containing css file. I using registerCssFile and registerScriptFile to load them in components/Controller. I have a trouble when using manage urlManager in config/main . My Page can't load file css and javascript because link change follow controller id.
This is error:
Controller site :
http://localhost/admin/site/resources/css/profile.css ........
controller user :
http://localhost/admin/user/resources/css/theme-blue.css ........
Please help me.
Thank all so much.

Related

What directory should the frontend user login template be put into?

Since I want to keep the admin login separate from the user login on my Wagtail site, I'm trying to use the login page settings mentioned in this section of the documentation to direct people to a custom login page. I added the following settings to my base.py folder in the settings directory for my WT project under #Wagtail settings:
WAGTAIL_FRONTEND_LOGIN_URL = '/login/'
WAGTAIL_FRONTEND_LOGIN_TEMPLATE = 'base/login.html'
My project is structured similar to the bakerydemo, so there is a base app that manages a lot of the shared pieces of the site. I put my login.html in the templates directory for the base app. See link below for screenshot.
Screenshot of project directories
I am getting a 404 error whenever I try to navigate to the login URL I specified. Is there a setting I missed? Did I put the template in the wrong directory? Still getting used to how WT structures projects, so any pointers would be very much appreciated.
You should only set one of WAGTAIL_FRONTEND_LOGIN_URL and WAGTAIL_FRONTEND_LOGIN_TEMPLATE, not both.
WAGTAIL_FRONTEND_LOGIN_TEMPLATE is used if you want to use Wagtail's own login view (located at the URL /_util/login/), but want to customise its template. If you're going down this route, a path like 'base/login.html' is correct - Django will search within all template directories for a file matching this path.
WAGTAIL_FRONTEND_LOGIN_URL is used if you want to provide your own view code. To use this, you'll need to write the view function (most likely inheriting from Django's LoginView) and register it in the URL config, then point WAGTAIL_FRONTEND_LOGIN_URL at the resulting URL. In this case, your view function will be responsible for rendering an appropriate template, so WAGTAIL_FRONTEND_LOGIN_TEMPLATE will not come into play.

MVC 4: How to add some specific URL directly to BundleConfig

How to bind a virtual url (other than "jquery.js") in a BundleConfig.
example : "www.xyz/xyz.js"
I can't keep one JS file in my local folder, I have to access it directly from web.
I tried this link, but it couldn't help me. Using CDN in MVC script bundle. What am I missing?
Thanks.
Himanshu Pareek.

Creating an extension in Yii

I am new to Yii. I have a jquery file manager working with plain PHP script. Now i want to integrate it with Yii Application. The flow is like, from index it will initiate jquery function, which will search for PHP connector script. My problem is, how can i include connector script in Yii so that the Jquery can access it
If you've got the rest of the extension working, then you can create a controller within this extension's directory to handle any actions for it. Then you can use the URL rules in the configuration to send specific URLs to it.
as of now i did not create any extensions, I put the connector script under assets directory and it just worked fine. I am sure this cannot be the best practice. I would like to get help on creating custom extensions for Yii

Module index page redirection not working in YII

i am new user to yii framewrok.i added one new module in the name coupon for admin side(in admin folder) in YII framework. the default index page is loading fine which is in the path of app/desig/admin/default/site/home.php
but when i try to access app/desig/admin/default/coupon/index.php . it wont redirect to that page. empty white page is loaded.
what is the issue?. how can i solve this?.
Did you specify the coupon module in the modules field of the configuration array in config/main.php? And did you import the model classes in the import field? Doing both of these should make it work.

Allow unauthorized users to access RichFaces Skin CSS files

I've created a small web application using AppFuse(with JSP as Web Framework) and RichFaces. There is a page that uses rich:dataTable that should be accessible without authentication.
To make this page public I put it into a folder called "public" and added the following line to the security.xml:
<intercept-url pattern="/public/*" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/>
The page is now accessible without authentication but the dataTable has no skin as the required CSS files are stored in a folder that apparently requires authentication...
RichFaces Skin CSS files are accessed at this path:
/a4j/s/3_3_2.SR1org/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAELXT5DOhSIAQ!sA18_.html
And when I try to access the files I get redirected to the login page.
So how do I allow unauthorized users to access these CSS files?
Thanks, Tom
EDIT: I've already tried adding the line below to security.xml but it didn't work:
<intercept-url pattern="/a4j/*" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/>
Solved problem by changing the line from my edit to:
<intercept-url pattern="/a4j/**" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/>
The second * does the trick...but I don't know why. :)