Cakephp 4.1 some issue i have so Please clearify?

I have used cakephp 4.1 version. But some functions are not properly behave use in my project ?

  • postLink method some times it’s works fine but sometimes not.

  • link method also same behave like postLink mehtod.

How can i use these methods ? But some times works and sometimes not.

Given that they work for others, and sometimes for you, it seems that the functions themselves are likely fine, and the problem is in how you’re using them. For us to help with that, you’ll need to show a little bit of how you’re using them in the cases where they don’t work, and specifically what symptoms you see.

I have used in navigation as links but that not works on my machine and my colleague works fine that links. That used in layout file. and on page i have page where used some postlink but not works also not show on hover address in browsers.
See code:

<?= $this->Html->link(__('1. Members'), ['controller'=>'accounts', 'action'=>'members',$event_id], ['escape'=>false, 'title'=>'dashboard','class' =>'nav-link nav_link','data-toggle'=>"tab"]) ?>
<?= $this->Form->postLink(__('DELETE EVENT'), ['controller'=>'UserEvents','action' => 'delete',$event_id], ['class'=>'btn btn-danger']) ?>

postLink creates a form with a link that submits it, which is why the URL doesn’t show when you hover over it like it does with a normal link.

Are you saying that the links generated by your first line of code here don’t work? Could it be because you’re using “accounts” as the controller name instead of “Accounts”? That would probably work if your server is on an OS where the filesystem is case-independent. Maybe your colleague is running Windows and you’re running Linux? This is very much a guess, as you still haven’t explained what “not working” actually means.

Yes, Your right I am using Linux machine and my colleague is windows. postLink i used to do some functionality but try inspect that but form not generate on dom for one postlink but on same page other postlinks are working fine. same code copied and tried. not works. and now i am facing the links are not working.

You said that this works for your colleague, but not you:

<?= $this->Html->link(__('1. Members'), ['controller'=>'accounts', 'action'=>'members',$event_id], ['escape'=>false, 'title'=>'dashboard','class' =>'nav-link nav_link','data-toggle'=>"tab"]) ?>

If you change it to 'controller' => 'Accounts' (upper case A), does that fix it for you?

As for the post links, again, until you tell us specifically what “not working” means, and show the specific code that is “not working”, there’s little we can do here. It seems you’re maybe saying that the HTML for the link sometimes doesn’t appear anywhere in your output? Are you simply forgetting to echo it, perhaps?

After you said changes not any effect same problem not works. if the links are works then i got any error but not single effect show my machine.