FAQ
Hi,
I have a probably trivial question.

Can I put in cakephp JsHelper :: link options
other jQuery method, for example. replaceWith ()?

Clarification, on the admin page I have more links (twitter bootstrap
buttons) on each individual record, one of the buttons should change when
clicked.

Eg I need to change the following links

from

<a href="/admin/posts/publish/17/1" class="btn btn-warning" id="17">
<i class="icon-ban-circle"> </ i>
</ a>


to

<a href="/admin/posts/publish/17/0" class="btn btn-success" id="17">
<i class="icon-ok-circle"> </ i>
</ a>


With JsHelper :: link, 'update' option we can change the contents inside
<a> </ a> tags, in this case it's <i> </ i> tags.

My JsHelper link:

<?php
echo $this->Js->link(
$this->Html->tag('i', '', array('class' => 'icon-ban-circle')),
array(
'action' => 'publish',
$post['Post']['id'],
'1'),
array(
'class' => 'btn btn-warning',
'id' => $post['Post']['id'],
'update' => '#' . $post['Post']['id'],
'escape' => false),
false);
?>

http://pastebin.com/uDMjqdpN

Thanks

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.

Search Discussions

  • Salines at Dec 4, 2012 at 4:47 pm
    *I solved.*


    1. Use html helper for creating links
    2. jshelper for creating js code, use JsHelper :: get, JsHelper ::
    event, and JsHelper :: Request


    --
    Like Us on FaceBook https://www.facebook.com/CakePHP
    Find us on Twitter http://twitter.com/CakePHP

    ---
    You received this message because you are subscribed to the Google Groups "CakePHP" group.
    To post to this group, send email to cake-php@googlegroups.com.
    To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
    Visit this group at http://groups.google.com/group/cake-php?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcake-php @
categoriesphp
postedDec 4, '12 at 12:01p
activeDec 4, '12 at 4:47p
posts2
users1
websitecakephp.org
irc#cakephp

1 user in discussion

Salines: 2 posts

People

Translate

site design / logo © 2022 Grokbase