Custom Pagination - laravel

I'm following the tutorial here in the docs:
Custom Presenters
But where do I place the Zurb Presenter class in my file system and how do I let Laravel know it exists?

There isn't really a defined place to put the actual file so you usually put it wherever feels the most natural to you. I'd probably create a presenters folder within your app folder and put it in there.
To let Laravel know where it is, there are a couple things you can do.
The first is adding it via composer. In your composer.json file, in the autoload classmap section, simply add your folder app/presenters. Then you will want to open up your command line, navigate to your project's directory, and run the command composer dump-autoload. Now it should automatically be loaded via composer.
The other solution would be to open up global.php in your app/start folder and add another entry in the ClassLoser::addDirectories() entry pointing to your new folder.
app_path().'/presenters',

Related

How to replace actions with html icon on backpackforlaravel

I have created this app with backpack for laravel where the table created by using backpack:build
I need to replace the word actions with an icon from line-awesome for example toolbox
<i class="las la-toolbox"></i>
I tried to add the HTML on the language file
resources/lang/vendor/backpack/en/crud.php but it's not working
In Backpack 4.0 or 4.1, you can change the default buttons any way you see fit by publishing the view file, and making changes to the published file. If Backpack sees a file with the same name & path inside your project, it'll use that one instead of the one in the package.
For example:
if this file exists: resources/views/vendor/backpack/crud/buttons/delete.blade.php
then Backpack will load that one, instead of the normal vendor/backpack/crud/src/resources/views/crud/buttons/delete.blade.php
For reference, you can find all default Backpack buttons here, in the Backpack/CRUD package. Overwriting one is just a matter of creating a file with the same name in the directory I mentioned above.
You can publish a blade file even easier by using this command:
php artisan backpack:publish crud/buttons/delete
Then make any changes you want to it, like removing the text to only leave the icon.
In Backpack 4.2 it is possible that an easier solution will be implemented for this particular need. See this PR for more information. Backpack 4.2 will be released in spring 2021.

How to rename the class or php file in laravel

I Want to rename my php file so that wherever the name exists or used it's name for some functions in the whole laravel file that also should be changed by the new name.
How do i do that in laravel.?
That's not a task for the Laravel framework. This is a task for your code editor, preferably an IDE like PHPStorm or NetBeans. Most IDEs have a function to refactor things like class names. In the case of PHPStorm you could right-click the class name you want to rename, select Refactor->rename. After that everything's self explanatory.

How to use hooks in CS-Cart for overriding footer.tpl file

I am new to cs-cart and
I am trying to use hooks in cs-cart. I had gone through some cs-cart website but not getting proper answer. Suppose if i want to override footer.tpl file with new content then how can i do it using hooks. Just tell me the steps what code to write in index.tpl file and where to keep new footer.tpl file.
I'd suggest you to check this brief guide: http://docs.cs-cart.com/hooks.
Assuming you're on a version 4.x.x:
You don't need to edit anything in index.tpl, just take note of the name of the hook you want to use (I suppose you want to use this one {hook name="index:footer"})
Write your new template and give it the name footer.[override/pre/post].tpl
Save this new .tpl file in themes/[your_theme_name]/templates/addons/my_changes/hooks/index (maybe you need to create such directories in your folders tree)
Make sure you have the "my changes" addon installed and active. You can check it through your admin area of the store.
And that's it, it should work.
Notes:
I've seen no standard "footer.tpl" file in version 4.x.x., so the above instructions work, but they only append content at the end of the page. Customization of such page area can be done via the layout and theme editor on the admin area of the store.
The naming algorithm mentioned on the documentation of cs-cart is for
version 3.x.x. Since version 4.x.x. the folders names have varied.
You should replace skins/[skin name]/[admin|customer] for
design/themes/[your_theme_name]/templates

Building CMS on top of CodeIgniter

Is it possible to build a CMS on top of CodeIgniter where the CMS files is separate from customization files? What I mean is, like CodeIgniter by default comes with 2 main folder, application and system folder. So, all your own files is placed in application folder so that next time you can easily update CodeIgniter by overriding the system folder and everything will still working fine.
So, can I store my files at custom folder?
E.g.:
system folder - codeigniter
my_system folder - CMS
application folder - All customization on each individual projects
You may use CodeIgniter's native application "Package", you can find the doc here : http://ellislab.com/codeigniter/user-guide/libraries/loader.html
You can store your file where you want expect system folder as you written. best approach is make folder on root named public or you want and put your file.
system folder contains everything codeigniter needs. application folder contains your specific code - it defaults to showing the welcome page.
consider naming your system folder with the codeigniter version number and date
makes it easier when you are upgrading
and you can easily switch to different versions directly from the index.php page by editing the file path to the folders

magento theme install

I have a rather simple question.
I want to install a new magento theme. In the documentation it says to overwrite the default 'app' and 'skin' folders with the theme's 'app' and 'skin' folders.
"8. Upload the "app" and "skin" folders from the template themeXX folder to your Magento root
folder (accept the replacement)"
However, when I am doing that, it prompts me to download magento again thru the magento installation wizard.
To me, it sounds more reasonable to just copy the contents of the 'app' and 'skin' folders of the new theme into the default 'app' and 'skin' folders of the magento framework as they contain some other folders that probably should remain intact.
Any suggestions please?
Did you first install the default Magento in the folder where you want to run it? You will need a running installation of Magento before you can go ahead and install a team.
If it keeps promting you check that you're on the right address in the address bar of your browser. To install magento you would have been redirected to [magento]/downloader/
As a last resort you could open up index.php and remove the code redirecting you the downloader folder, but at this point you might be better off re-installing Magento (remove everything in the directory and follow the install steps again) since something probably went wrong.
After you've installed Magento check if you see the default store interface and can access the admin areas before installing anything else (including a theme)!
There's absolutely no need to overwrite the app and skin folders. In fact, if you do so, you could easily overwrite just about all of Magento's functionality and break your system.
That would be why you're getting a new installation prompt.
What's the theme you are installing, and what's the link to the page where they give that information?
Generally a theme will be packaged will a folder structure that looks like this:
theme_package
theme_package/app
theme_package/app/code
theme_package/app/code/local
theme_package/app/code/local/Namespace
theme_package/app/code/local/Namespace/Themename
theme_package/app/code/local/Namespace/Themename/Block
theme_package/app/code/local/Namespace/Themename/etc
theme_package/app/design
theme_package/app/design/frontend
theme_package/app/design/frontend/base
theme_package/app/design/frontend/base/themename
theme_package/app/design/frontend/base/themename/layout
theme_package/app/design/frontend/base/themename/template
theme_package/skin
theme_package/skin/css
theme_package/skin/js
and so on.
This content needs to be merged as you said.
Many of these folders already exist, for instance app/code/, app/design/frontend/base/, skin/css/, skin/js/
Just copy any new files or folders.
#george i know it's been a while since anything has been said on here, but i just want people to know for future reference that you only have to add to the app/design/frontend/default/[theme name] and skin/frontend/default/[theme name] folders like sg3s stated. i lost about 4 hours to this tonight b/c i bought a theme and they didn't specify that you only need to add to the folders not overwrite them.

Resources