logo
down
shadow

CakePHP 3 look at plugin controller first


CakePHP 3 look at plugin controller first

By : user2951061
Date : November 18 2020, 01:01 AM
This might help you Write a custom route class that you'll use for the route to that controller(s).
See the routing chapter of the manual for how to do that.
code :


Share : facebook icon twitter icon
CakePHP: Use function from Plugin Controller in Main Controller

CakePHP: Use function from Plugin Controller in Main Controller


By : anand totala
Date : March 29 2020, 07:55 AM
like below fixes the issue Short answer: Use OOP and extend the other controller. Also get an understanding of MVC. You are not supposed to use a method of a controller inside another controller, in CakePHP this should be done as a component. They can be shared between controllers. Check the CakePHP Book.
Also the name of the plugin and the method name indicate that this is a bad plugin. This sounds like somebody did not know about the Auth component of CakePHP. Again, check the book for the AuthComponent. You want a custom authentication adapter.
how can controller call model in plugin? (cakephp 2.x(2.6)) (app -> plugin -> PluginName -> Controller)

how can controller call model in plugin? (cakephp 2.x(2.6)) (app -> plugin -> PluginName -> Controller)


By : JoeSham
Date : March 29 2020, 07:55 AM
hope this fix your issue it seems from app -> model -> exampleModel.php vs Plugin -> Admin -> Model -> exampleModel.php that you have two identical classes in those two directories, but that is not supported, I'm afraid:
CakePHP Accessing Plugin Controller

CakePHP Accessing Plugin Controller


By : Ammar Saeed
Date : March 29 2020, 07:55 AM
I wish this help you Ok, so I am using a ReportManager plugin. I am able to use it as is by using this url: 'localhost/AppName/report_manager/reports' , Add 'plugin' => 'PLUGIN NAME HERE'
code :
<li id="sidebar-header">
  <?php
      echo $this->Html->link(
     'Reports',
        array(
          'plugin' => 'report_manager',
          'controller' => 'reports',
          'action' => 'index',                          
             )
      );
   ?>
<?php
    echo $this->Html->link(
      'Home',
       array(
          'plugin' => false,
          'controller' => 'members',
          'action' => 'index',
       )
    );
?>
How to call plugin controller from url in cakephp 3

How to call plugin controller from url in cakephp 3


By : Mohan Krishna Rayapu
Date : March 29 2020, 07:55 AM
like below fixes the issue I have an admin Panel plugin named as PanelAdmin. This is CategoriesController.php , You need to add routes connecting to /PanelAdmin
code :
$routes->connect('/PanelAdmin', [
    'plugin' => 'PanelAdmin', 
    'controller' => 'Categories', 
    'action' => 'index'
]);
Missing Controller for a plugin in cakephp 3.6

Missing Controller for a plugin in cakephp 3.6


By : Rocky
Date : March 29 2020, 07:55 AM
Hope that helps I guess it was issue of routing I have tried multiple combinations of URL for the plugin name and the controller name.
What was done in View (.ctp)
code :
 <?php echo $this->Html->link('<h3>Package Name</h3>', ['controller'=>'TourPackages', 'plugin'=>'TourPackages', 'action'=>'sample'], ['title'=>'Package Name', 'class'=>'', 'escape'=>false]);?>
Router::plugin(
'TourPackages',
['path' => '/tour-packages'],
function (RouteBuilder $routes) {
    $routes->get('/tour-packages/tour-packages/*', ['controller' => 'TourPackages']);
    $routes->fallbacks(DashedRoute::class);
}
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org