Change the Edit link

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 429

Change the Edit link

Post by Bishu »

Change the default the edit link of href.
normally the default edit lint is - tableedit.php
and i would like to change to another link.
edit->href = "table2.php"


sangnandar
User
Posts: 980

Post by sangnandar »

The tablename for Edit Link is hardcoded.
See function GetEditUrl() in table-info.php

So the only way you can change tablename is during,
ListOptions_Rendered(){
// copy Edit link from page HTML
// change the tablename
$this->ListOptions->Items["edit"]->Body = ...yourEditedLink... ;
}

A more elegant solution would be to use php str_replace(), such as:
$body = $this->ListOptions->Items["edit"]->Body ; // get initial Edit link
$body = str_replace(...) ; // find old-tablename and replace with new-tablename
$this->ListOptions->Items["edit"]->Body = $body ;


Post Reply