tattersoftware / codeigniter4-assets Goto Github PK
View Code? Open in Web Editor NEWAsset handling for CodeIgniter 4
License: MIT License
Asset handling for CodeIgniter 4
License: MIT License
is it possible to disable dynamic generation of parameters for js and css files?
because it does not allow the file debugger.
name_file.js?v=1599757859
only name_file.js
I could not understand if it is generated by codeigniter or by this library.
I apologize if it's off the subject.
Allow source field in manifests to be a URL for CDN harvesting.
Define assets groups that can be assigned to routes or loaded on-the-fly and include required files for a given module (e.g. "ChartJS" would include both the JS and CSS files)
Hi. On readme page small fix word "assset":
echo view('main', ['assset' => $asset]);
Handy for troubleshooting would a Toolbar Collector with either:
RouteCollection
assets for the current routehow to order the sourses?
for example: jquery.js - first, then other scripts...
Add an optional Filter to inject tags automatically instead of having to call the service in every layout template
Good Morning,
I configured the library as described in the readme file.
I ran the command
php spark assets: publish
in the project root as indicated.
He made me folders
public / assets / vendor
bootstrap
jquery
dropzone
the question?
how should I configure the app / config / assets.php file
I don't understand the references to the files.
for bootstrap they are bootstrap / dist /
for jquery?
Thanks
PHPUnit uses a fresh class instance on every run, so modifying $this->published
is useless. This needs to be reworked as a static property, probably private but maybe protected?
Hi!
Given the code:
<?= \Tatter\Assets\Asset::createFromPath('main.css') ?>
<?= \Tatter\Assets\Asset::createFromPath('main.js') ?>
It now produces:
<link href="http://example.com/assets\main.css?v=1644518679" rel="stylesheet" type="text/css" />
<script src="http://example.com/assets\main.js?v=1644518679" type="text/javascript"></script>
While it does seem to work, and browsers are very forgiving, it's not correct.
I think the issue is here: https://github.com/tattersoftware/codeigniter4-assets/blob/develop/src/Asset.php#L57
self::$config->uri = rtrim(self::$config->uri, '/\\') . DIRECTORY_SEPARATOR;
This line should probably revert back to a simple '/' value instead of DIRECTORY_SEPARATOR.
Consider merging the "publish" functionality of Manifests with Tatter\Patches.
Sometimes important JS files need to be loaded earliest (e.g. JQuery) and it would be great to have a way to force those into head natively.
Currently manifests from every namespace will publish - this causes a lot of duplicates (Bootstrap.json anyone?). Manifests->publish()
should track hashes of each file published and skip dupes.
Instead of using the Filters.php solution to register an alias this library should use Registrar
(compare to Shield).
Would it be easier to apply Assets directly to the routes via app/Config/Routes, similar to how Filters are handled (as Route input)? Or move entirely to Filters with asset groups as input?
$routes->add('reports/chart', ['filter' => 'assets:chartjs,jquery,bootstrap']);
Good morning,
I would need to upload single js files to a specific page, but after loading the main js files.
example:
general for each page
<? = service ('assets') -> js ()?>
in assets.php does not include chart.js
single only for one page
<? = service ('assets') -> tag ('vendor / chartjs / chart.js')?>
this is possible?
I am using the library in a new project.
I set https for security but scripts and css are always loaded from http not https.
"php": "^7.3||^8.0",
"codeigniter4/framework": "^4.1.5",
"codeigniter4/translations": "^4.1",
"components/bootstrap-default": "^3.3",
"tatter/assets": "^2.3",
My File in app/Config/
app.php
public $baseURL = 'https://mysite.loc'
Assets.php
public $webBase = 'https://mysite.loc'
error:
Mixed Content: The page at 'https://mysite.loc/index.php?debug=true&XDEBUG_SESSION_START=netbeans-xdebug' was loaded over HTTPS, but requested an insecure script 'http://mysite.loc.loc/?debugbar'. This request has been blocked; the content must be served over HTTPS.
Mixed Content: The page at 'https://mysite.loc/index.php?debug=true&XDEBUG_SESSION_START=netbeans-xdebug' was loaded over HTTPS, but requested an insecure script 'http://mysite.loc/assets/js/caricamento.js?v=1639567566'. This request has been blocked; the content must be served over HTTPS.
I don't know if it's an apache2 configuration problem or if Assets is misconfigured if I need to enable a flag ssl = true
In src/Assets.php the controller is determined by stripping $routes->getDefaultNamespace()
from $router->controllerName()
, but this only works for the default namespace. Need to find a way to strip the namespace of the current controller instead.
Example:
Controller \Tatter\Files\Controllers\Files
looks in assets/tatter/files/controllers/files
Awesome work on this project!
So forgive my lack of understanding on this service library, but I was just wondering if it is possible to configure this dynamically.
The reason I ask is that I would like to use some logic to build the $routes
property.
Hi @MGatner ,
I'm trying to upgrade to v3. I already changed service behaviour to filter, but I have a problem with publishers.
I'm tried to setup own publisher but I got an error like:
/app/vendor/almasaeed2010/adminlte/dist/js/adminlte.min.js fails the following restriction for /app/public/: #\.(?css|js|map|htm?|xml|json|webmanifest|tff|eot|woff?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i```
then I tried to use your Frontend library and it's same. Can you help me what I'm doing wrong.
I'm running dev in docker.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.