Welcome Guest, Not a member yet? Register   Sign In
add css/js within view
#1

[eluser]Unknown[/eluser]
Is it possible to declare css/js files from within a view and have them included in a specific element of a page that is outside the scope of the view?

example.

view a.php requires css/style.css and js/scripts.js

rendered html:

Code:
<html>
<head>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
...
[removed][removed]
</body>
</html>

and if multiple css or js files were required, it would display them all together.


Is this possible?
#2

[eluser]PravinS[/eluser]
yes you can declare like that, also give absolute path of css and js files
#3

[eluser]Unknown[/eluser]
Pravin, I know that I can declare them but I want to declare them within views that do not contain the <head> element.

How can I get css files that are needed within a view to be in the head element without defining the css files within the controller?
#4

[eluser]PravinS[/eluser]
there will be no issue if there is no <head> tag, try declaring it in your view as it is at the top




Theme © iAndrew 2016 - Forum software by © MyBB