Friday 15 January 2010

cakephp - How to add a link in the controller message? -



cakephp - How to add a link in the controller message? -

i have designed online shopping site in have included "compare products" option.

so, after compare button clicked, dismissable alert box message, "product added compare" shown. but, need give link users click , go straight compare page.

like "product added compare. can view clicking here".

but, don't know how add together link.

the code used is,

$this->session->setflash(__('product added compare '), 'success');

kindly tell me how add together link message.

i found in other link , works fine. t h n k s efforts , answers.

try this.

1) created new element session_flash_link.ctp in app/views/elements.

2) added next code in session_flash_link.ctp:

<div id="flashmessage" class="message"> <?php echo $message; echo $this->html->link($link_text, $link_url, array("escape" => false)); ?> </div>

3) code in controller:

$this->session->setflash("shop has been saved. ", "session_flash_link", array( "link_text" => "return shop management &raquo;", "link_url" => array( "controller" => "shops", "action" => "manage", "admin" => true ) ));

cakephp

No comments:

Post a Comment