I have read the documentation about how you can achieve results from within your database, but I still say that Where do I want to go through the 'paging' code 'Paginizing a Alloconut model' approach within my application because I am using the type of models I am using. I'm not sure where to put 'pagnette' methods.
Should I create a custom controller that:
Edit:
- Results within my custom controller Functions such as:
Strong> paginate_albums_controller.php (administrator)
Endorse (15); }
index.blade.php (see):
& lt; Div class = "container" & gt; & Lt ;? Php foreach ($ album as album $); ? & Gt; & Lt ;? Php echo $ album- & gt; Album_name; ? & Gt; & Lt ;? Php endforeach; ? & Gt; & Lt; / Div & gt; & Lt ;? Php echo $ album- & gt; Link (); ? & Gt; Edit: If I use the above structure, then I can use that custom controller and call the 'index ()' method from the third party controller. Can I use GalleryController.php index.blade.php ? ** GalleryController.php (Controller that uses index.blade.php currently): ** Extend the Classroom GalleryController Base Controller [/ * * Album Model ** / $ protected album; / * * Photo Model * / Protected $ Photo; / * * Instant / Public Function __ Composition () {$ this-> album = \ app :: make ('Repositories \ album repository'); $ This- & gt; Photo = \ app :: build ('repositories' photoRepository'); } / * * List all albums / public function index () {$ allAlbums = $ this- & gt; Album-> all (); $ This- & gt; Layout-> Content = \ View: Creating ('Gallery :: Index', Arrays ('allAlbums' => $ allAlbums)); / * Is it possible to add code here, which will estimate the number of albums on my custom controller 'paginate_albums_trontroller' ????
Any help is much appreciated because I'm still new to using Laravel PHP.
I think it will be okay by adding its indexing method to the class gallery controller.
Public function index () {/ * Change: $ allAlbums = $ this- & gt; Album- & gt; Pagination (15); * / / * Copy: * / $ allAlbums = Album :: PageGate (15); $ This- & gt; Layout-> Content = \ View: Creating ('Gallery :: Index', Arrays ('allAlbums' => $ allAlbums)); }
Comments
Post a Comment