user1477673
user1477673

Reputation: 13

How to call CakePHP base application from plugin controller?

I have a plugin, and add relationship with user Model(base application) In the plugin view, I want to reference user's details based on user_id,

I get the user_id from plugin, but the url is pluginName/users/view/1

<?php echo $this->Html->link($event['User']['username'], array('controller' => 'users', 'action' => 'view', $event['User']['id'])); ?>

How to redirect to the App/users/view/1 ?

Many thanks

Upvotes: 1

Views: 1524

Answers (2)

chetanspeed511987
chetanspeed511987

Reputation: 2025

You have to use 'plugin'=>null

 <?php echo $this->Html->link($event['User']['username'], array('plugin'=>null,'controller' => 'users', 'action' => 'view', $event['User']['id'])); ?>

Upvotes: 0

tigrang
tigrang

Reputation: 6767

You set plugin => false in the url array for it to use the "base" app.

<?php echo $this->Html->link($event['User']['username'], array('plugin' => false, 'controller' => 'users', 'action' => 'view', $event['User']['id'])); ?>

Upvotes: 1

Related Questions