New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding plugin templates, plugin installed via composer #11910
Comments
I got around to looking at this today, and was able to override a vendored plugin view without issues. My scenario was as follows:
<?php
namespace Company\Contacts\Controller;
use Company\Contacts\Controller\AppController;
class AddressesController extends AppController
{
public function index()
{
}
}
$routes->get('/addresses', ['plugin' => 'Company/Contacts', 'controller' => 'Addresses', 'action' => 'index']);
The names used in the documentation aren't very clear. I'll improve them. |
Refs cakephp/cakephp#11910 Refs #5338
Closing as I wasn't able to reproduce. |
Hi @markstory The problem is not in the plugins created with "bake", it is in the plugins installed via composer.
It does not work
It does not work
it works!
I think that is not what is detailed in the documentation. Maybe there is something wrong in this plugin? If there is, what is it? Regards! |
Hi @markstory In relation with improving cakephp/docs@3ee74aa Company is VendorName? in my case, ivanamat? |
You haven't used a vendor name in your namespace https://github.com/ivanamat/cakephp3-aclmanager/blob/bc6cfe9745ea5f7aae7da73a0cc6d976cbc57225/composer.json#L24 Hence |
Hi @ADmad Then, It should be?
Thnx! |
It doesn't have to be. Using vendor name at top level in your namespace is optional. For example core plugins like DebugKit, Bake don't use it. If you do use vendor name then it should be camel cased so |
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.5
Platform and Target: Win, OSX, Linux
What happened
In the documentation, where explain how to override plugin template, explain two options, plugins inside plugins folder, and plugins installed via composer. When i try override a plugin template installed vía composer, as described in the manual, it does not work. To override a plugin templates installed via composer, need to do as a plugin inside plugins folder.
Creating this file would allow you to override plugins/ContactManager/src/Template/Contacts/index.ctp.
If your plugin is in a composer dependency (i.e. ‘TheVendor/ThePlugin’), the path to the ‘index’ view of the Custom controller will be:
What you expected to happen
As @markstory comment in this issue:
The text was updated successfully, but these errors were encountered: