how to get limited number of records and order by rand ? |
ok there is a handy site for software that you can get via composer : https://packagist.org/
lets say you want to allow people to download the text version of a blog you have. So i enter html2pdf in search box of packagist : Top of the list i see : spipu/html2pdf i left click on it and then see: composer require spipu/html2pdf thats tells me that if i have composer set up correctly , i open a terminal and cd to root directory of web dev and run: Code: composer require spipu/html2pdf i then see in vendor directory: spipu and also notice a chnage in composer.json Code: "spipu/html2pdf": "^5.2", some software obtained via composer have deps , and to make sure you have them, just run after running Code: composer require spipu/html2pdf A few things to note here. If your using appstarter, vendor directory is where stuff goes and thus is critical to keep. System directory if its there is more for ref as far as i can see. Once you have software , its now easy when you need to update. For instance ig a new version of codeigniter appears you can run Code: composer update codeigniter4/framework to avoid getting dev you can use --no-dev oh one more thing, composer has autoload so it knows where the software is : to use for example spipu in a controller i found all i had to do was put at top of controller: Code: use Spipu\Html2Pdf\Html2Pdf; Code: $html2pdf = new Html2Pdf(); if you manually set something up not using composer then you have to use the autoloader of CI4 which is : app/Config/Autoload.php if it has a namespace use $psr4 = [ ] if not there is a class map section below that .That should be enough to get you going ? |
Messages In This Thread |
how to get limited number of records and order by rand ? - by kikloo - 11-06-2020, 06:49 AM
RE: how to get limited number of records and order by rand ? - by captain-sensible - 11-06-2020, 12:58 PM
RE: how to get limited number of records and order by rand ? - by kikloo - 11-06-2020, 02:33 PM
RE: how to get limited number of records and order by rand ? - by captain-sensible - 11-07-2020, 05:46 AM
|