Re: How to include a button which links to a view?

2010-02-16 Thread Miles J
Or you can just do it the normal way:

Go to

On Feb 16, 8:17 am, sebb86  wrote:
> WebbedIT
>
> It works. Thanks a lot! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-16 Thread sebb86
WebbedIT

It works. Thanks a lot! :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-16 Thread WebbedIT
You've got your title tag in $html->image instead of $html->link:

$html->link($html->image("delete.png", array("alt" =>"delete")),
array("controller" =>&contr, "action" => "delete", $row[$class]
['id']), array('class'=>'delete', "title" => "delete"),
sprintf(__('Are you sure you want to delete# %s?', true), $row[$class]
['id']), false)

You don't need to wrap your url array in html->url() either, supplying
an array for the url automagically creates the required url.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-14 Thread sebb86
WebbedIT

Thanks for your addition!
I included your idea and now, my image moves a little bit, when i move
the mouse over it. :-)
But unfortunately my title / tag option dont works anymore when i move
my mouse over the picture. :/

view:
[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
&contr, "action" => "delete", $row[$class]['id'])),
array('class'=>'delete'),  sprintf(__('Are you sure you want to delete
# %s?', true), $row[$class]['id']), false); ?>
[code]

Do you have an idea to fix this? (Is there something in css?)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-13 Thread WebbedIT
You may want to take a look at CSS image replacement techniques at
some point too.

The following would allow you to use a single 50 x 40px image with 2
states using CSS to move the background image when hovering to show
the hover image.  Without CSS enabled, i.e. when screen readers and
search engines view your site, they see a standard text link, but for
the majority of users they see a nice graphical link.

View:
$html->link('Delete', array('action' => 'delete', $row['Model']
['id']), array('class'=>'delete'), 'Are you sure?');

CSS:
a.delete {
  text-indent:-5000px;
  display:block;
  width:50px;
  height:20px;
  background:transparent url(/img/delete-icon.gif) no-repeat 0 0;
}
a.delete:hover {
  background-position:0 -20px;
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Hello all,

i finally got it working!!! :-)

i merged some ideas i found in the google-group, so the following code
works for me. It is an image, which links to a delete-view and it
outputs a confirm message with the current row number (id).

[code]
link($html->image("delete.png", array("alt" =>
"delete", "title" => "delete")), $html -> url(array("controller" =>
"sample_controllers", "action" => "delete", $row['SampleController']
['id'])), array(), sprintf(__('Are you sure you want to delete # %s?',
true), $row['SampleController']['id']), false); ?>
[/code]

With "title", you can show something when you move the mouse over the
image.

Hope this helps!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread Jeremy Burns
I agree, but sites must degrade nicely. With no java, the standard baked delete 
function deletes without warning. That is not nice degradation. If a site 
doesn't reorder a list without refreshing the page, that's OK.

Jeremy Burns
jeremybu...@me.com


On 12 Feb 2010, at 10:20, WebbedIT wrote:

>> I struggled with this for while as I don't like relying on java being 
>> switched on.
> 
> I think the worry as to whether javascript is turned on or not is
> becoming more and more mute.  Look at really big sites/applications,
> they heavily rely on javascript for a lot of their features yet it
> does not negatively impact on their global online dominance.
> 
> How many Web 2.0 (for want of a better term) sites do not use Ajax?
> Take Ebay's ability to alter the ordering of their listing pages, turn
> off javascript it's rendered useless.
> 
> Is this a case of coding for the minority at the detriment of the
> majority?
> 
> @ Guillermo: if you agree that the use of javascript is not an issue
> then you use the following
> 
> $html->link('Delete', array('action' => 'delete', $row['Model']
> ['id']), null, 'Are you sure?')
> 
> It's part of Cake's core automagic so the dev team obviously don't
> have a problem with relying on javascript.
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread WebbedIT
> I struggled with this for while as I don't like relying on java being 
> switched on.

I think the worry as to whether javascript is turned on or not is
becoming more and more mute.  Look at really big sites/applications,
they heavily rely on javascript for a lot of their features yet it
does not negatively impact on their global online dominance.

How many Web 2.0 (for want of a better term) sites do not use Ajax?
Take Ebay's ability to alter the ordering of their listing pages, turn
off javascript it's rendered useless.

Is this a case of coding for the minority at the detriment of the
majority?

@ Guillermo: if you agree that the use of javascript is not an issue
then you use the following

 $html->link('Delete', array('action' => 'delete', $row['Model']
['id']), null, 'Are you sure?')

It's part of Cake's core automagic so the dev team obviously don't
have a problem with relying on javascript.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-12 Thread sebb86
Guillermo

No, i'd like something like a pop-up warning window, which says: "are
you sure you want to delete?".
Is this possible with an image-link?

[code]
image("delete.png", array("alt" => "delete",
'url' => array('controller' => 'hardware_units', 'action' => 'delete',
'id' => $hardware_unit['HardwareUnit']['id'])));?>
[\code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Addition:
this works with the "$hrml->link" but not with "$html->image". :-(

[code]
link('Delete', array('action' => 'delete', 'id' =>
$hardware_unit['HardwareUnit']['id']), null, 'Sind sie sicher?'); ?>
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Guillermo

No, i'd like something like a pop-up warning window, which says: "are
you sure?".


On 11 Feb., 16:57, Guillermo Mansilla  wrote:
> you already did with this line
> $this->Session->setFlash('hardware unit with id: '.$id.' has been
> deleted');
>
> make sure you have set up the session messages var in your layout
>
> On 11 February 2010 11:25, sebb86  wrote:
>
> > Hello all,
>
> > thanks for all your answers. After reading all your answers, i've
> > decided to use a image, which links to a page.
> > Could someone help me to add a warning-message, e.g. when i delete
> > something???
>
> > Here is my image/link code from the view:
> > [code]
> >        image("delete.png", array("alt" => "delete",
> > 'url' => array('controller' => 'hardware_units', 'action' => 'delete',
> > 'id' => $hardware_unit['HardwareUnit']['id'])));?>
> > [\code]
>
> > And my delete function in the controller:
> > [code]
> > function delete($id)
> >        {
> >                $this->HardwareUnit->del($id);
> >                $this->Session->setFlash('hardware unit with id: '.$id.' has 
> > been
> > deleted');
> >                $this->redirect(array ('action' => 'index'));
> >        }
> > [\code]
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread Jeremy Burns
I struggled with this for while as I don't like relying on java being switched 
on. Here's an article I put together that borrows heavily from other 
contributors here. It might help. 
http://www.jeremy-burns.co.uk/2009/12/cakephp-adding-a-delete-confirm-function/

Jeremy Burns
jeremybu...@me.com


On 11 Feb 2010, at 15:55, sebb86 wrote:

> Hello all,
> 
> thanks for all your answers. After reading all your answers, i've
> decided to use a image, which links to a page.
> Could someone help me to add a warning-message, e.g. when i delete
> something???
> 
> Here is my image/link code from the view:
> [code]
>image("delete.png", array("alt" => "delete",
> 'url' => array('controller' => 'hardware_units', 'action' => 'delete',
> 'id' => $hardware_unit['HardwareUnit']['id'])));?>
> [\code]
> 
> And my delete function in the controller:
> [code]
> function delete($id)
>   {
>   $this->HardwareUnit->del($id);
>   $this->Session->setFlash('hardware unit with id: '.$id.' has 
> been
> deleted');
>   $this->redirect(array ('action' => 'index'));
>   }
> [\code]
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread Guillermo Mansilla
you already did with this line
$this->Session->setFlash('hardware unit with id: '.$id.' has been
deleted');

make sure you have set up the session messages var in your layout

On 11 February 2010 11:25, sebb86  wrote:
> Hello all,
>
> thanks for all your answers. After reading all your answers, i've
> decided to use a image, which links to a page.
> Could someone help me to add a warning-message, e.g. when i delete
> something???
>
> Here is my image/link code from the view:
> [code]
>        image("delete.png", array("alt" => "delete",
> 'url' => array('controller' => 'hardware_units', 'action' => 'delete',
> 'id' => $hardware_unit['HardwareUnit']['id'])));?>
> [\code]
>
> And my delete function in the controller:
> [code]
> function delete($id)
>        {
>                $this->HardwareUnit->del($id);
>                $this->Session->setFlash('hardware unit with id: '.$id.' has 
> been
> deleted');
>                $this->redirect(array ('action' => 'index'));
>        }
> [\code]
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Hello all,

thanks for all your answers. After reading all your answers, i've
decided to use a image, which links to a page.
Could someone help me to add a warning-message, e.g. when i delete
something???

Here is my image/link code from the view:
[code]
image("delete.png", array("alt" => "delete",
'url' => array('controller' => 'hardware_units', 'action' => 'delete',
'id' => $hardware_unit['HardwareUnit']['id'])));?>
[\code]

And my delete function in the controller:
[code]
function delete($id)
{
$this->HardwareUnit->del($id);
$this->Session->setFlash('hardware unit with id: '.$id.' has 
been
deleted');
$this->redirect(array ('action' => 'index'));
}
[\code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread anl hp
@sebb86: You should read something about RESTful applications, will help you
how to think about the correct way of send or get data from the server ;)

anl


On Thu, Feb 11, 2010 at 3:16 PM, mike karthauser wrote:

> even simpler would be to use a standard
>
> link('foo',array('controller'=>'some controller',
> 'action'=>'some action')); ?>
>
> and just style the anchor in css.
>
> ie
>
> a { border:1px solid #000; padding:5px}
>
> its a bit epic to have to create forms to make buttons considering you
> are not passing any data to the pages and just need to affect the
> presentation of the link.
>
>
> On Thu, 2010-02-11 at 09:32 -0430, Guillermo Mansilla wrote:
> > You have to create your button and lock it inside a form which points
> > to a controller action that renders a view.
> > in your view
> > echo $form->create('MyForm', array('controller'=>'foo', 'action' =>
> > 'bar'));
> > echo $form->end('My button');
> >
> > in your foo_controller:
> >
> > function bar(){
> >$this->render('theViewYouWantToRender');
> > }
> >
> >
> >
> >
> > On 11 February 2010 09:17, sebb86  wrote:
> > Jeremy
> >
> > Thanks for your answer.
> > But actually i'd like to create a button (not a
> > button-picture), which
> > links to a view.
> > I don't want to add a picture, because every button would have
> > an
> > other description.
> > So is this possible to realize or must i create lots of
> > pictures? ;-)
> >
> > Thanks.
> >
> >
> > Check out the new CakePHP Questions site http://cakeqs.org and
> > help others with their CakePHP related questions.
> >
> > 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+unsubscr...@googlegroups.comFor
> >  more options, visit
> > this group at http://groups.google.com/group/cake-php?hl=en
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread anl hp
@Guillermo: Sorry, the message was for him! what you say is the correct way
of do it no matter what ^^

anl


On Thu, Feb 11, 2010 at 3:13 PM, Guillermo Mansilla wrote:

> Yes you are right, but since he said he needed a button I told him how to
> use it to achieve what he wanted. But in theory you are right he should use
> a link and apply some style, however that link will have to point to a
> controller function which renders a desired view, just like I told him. ;-)
>
> On 11 February 2010 09:39, anl hp  wrote:
>
>> Why you want to use a button?
>> Buttons must be used when your sending a post request to the server (and
>> this request should change something in the app)
>> When what you want is just do a get request, you should use links (you can
>> style it as a button if you want)
>>
>> anl
>>
>>
>>
>> On Thu, Feb 11, 2010 at 3:02 PM, Guillermo Mansilla 
>> wrote:
>>
>>> You have to create your button and lock it inside a form which points to
>>> a controller action that renders a view.
>>> in your view
>>> echo $form->create('MyForm', array('controller'=>'foo', 'action' =>
>>> 'bar'));
>>> echo $form->end('My button');
>>>
>>> in your foo_controller:
>>>
>>> function bar(){
>>>$this->render('theViewYouWantToRender');
>>>
>>> }
>>>
>>>
>>>
>>>
>>> On 11 February 2010 09:17, sebb86  wrote:
>>>
 Jeremy

 Thanks for your answer.
 But actually i'd like to create a button (not a button-picture), which
 links to a view.
 I don't want to add a picture, because every button would have an
 other description.
 So is this possible to realize or must i create lots of pictures? ;-)

 Thanks.

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 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+unsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread mike karthauser
even simpler would be to use a standard 

link('foo',array('controller'=>'some controller',
'action'=>'some action')); ?>

and just style the anchor in css.

ie 

a { border:1px solid #000; padding:5px}

its a bit epic to have to create forms to make buttons considering you
are not passing any data to the pages and just need to affect the
presentation of the link.


On Thu, 2010-02-11 at 09:32 -0430, Guillermo Mansilla wrote:
> You have to create your button and lock it inside a form which points
> to a controller action that renders a view.
> in your view
> echo $form->create('MyForm', array('controller'=>'foo', 'action' =>
> 'bar'));
> echo $form->end('My button');
> 
> in your foo_controller:
> 
> function bar(){
>$this->render('theViewYouWantToRender');
> } 
> 
> 
> 
> 
> On 11 February 2010 09:17, sebb86  wrote:
> Jeremy
> 
> Thanks for your answer.
> But actually i'd like to create a button (not a
> button-picture), which
> links to a view.
> I don't want to add a picture, because every button would have
> an
> other description.
> So is this possible to realize or must i create lots of
> pictures? ;-)
> 
> Thanks.
> 
> 
> Check out the new CakePHP Questions site http://cakeqs.org and
> help others with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit
> this group at http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread Guillermo Mansilla
Yes you are right, but since he said he needed a button I told him how to
use it to achieve what he wanted. But in theory you are right he should use
a link and apply some style, however that link will have to point to a
controller function which renders a desired view, just like I told him. ;-)

On 11 February 2010 09:39, anl hp  wrote:

> Why you want to use a button?
> Buttons must be used when your sending a post request to the server (and
> this request should change something in the app)
> When what you want is just do a get request, you should use links (you can
> style it as a button if you want)
>
> anl
>
>
>
> On Thu, Feb 11, 2010 at 3:02 PM, Guillermo Mansilla 
> wrote:
>
>> You have to create your button and lock it inside a form which points to a
>> controller action that renders a view.
>> in your view
>> echo $form->create('MyForm', array('controller'=>'foo', 'action' =>
>> 'bar'));
>> echo $form->end('My button');
>>
>> in your foo_controller:
>>
>> function bar(){
>>$this->render('theViewYouWantToRender');
>>
>> }
>>
>>
>>
>>
>> On 11 February 2010 09:17, sebb86  wrote:
>>
>>> Jeremy
>>>
>>> Thanks for your answer.
>>> But actually i'd like to create a button (not a button-picture), which
>>> links to a view.
>>> I don't want to add a picture, because every button would have an
>>> other description.
>>> So is this possible to realize or must i create lots of pictures? ;-)
>>>
>>> Thanks.
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread anl hp
Why you want to use a button?
Buttons must be used when your sending a post request to the server (and
this request should change something in the app)
When what you want is just do a get request, you should use links (you can
style it as a button if you want)

anl


On Thu, Feb 11, 2010 at 3:02 PM, Guillermo Mansilla wrote:

> You have to create your button and lock it inside a form which points to a
> controller action that renders a view.
> in your view
> echo $form->create('MyForm', array('controller'=>'foo', 'action' =>
> 'bar'));
> echo $form->end('My button');
>
> in your foo_controller:
>
> function bar(){
>$this->render('theViewYouWantToRender');
>
> }
>
>
>
>
> On 11 February 2010 09:17, sebb86  wrote:
>
>> Jeremy
>>
>> Thanks for your answer.
>> But actually i'd like to create a button (not a button-picture), which
>> links to a view.
>> I don't want to add a picture, because every button would have an
>> other description.
>> So is this possible to realize or must i create lots of pictures? ;-)
>>
>> Thanks.
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread Guillermo Mansilla
You have to create your button and lock it inside a form which points to a
controller action that renders a view.
in your view
echo $form->create('MyForm', array('controller'=>'foo', 'action' => 'bar'));
echo $form->end('My button');

in your foo_controller:

function bar(){
   $this->render('theViewYouWantToRender');
}




On 11 February 2010 09:17, sebb86  wrote:

> Jeremy
>
> Thanks for your answer.
> But actually i'd like to create a button (not a button-picture), which
> links to a view.
> I don't want to add a picture, because every button would have an
> other description.
> So is this possible to realize or must i create lots of pictures? ;-)
>
> Thanks.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread sebb86
Jeremy

Thanks for your answer.
But actually i'd like to create a button (not a button-picture), which
links to a view.
I don't want to add a picture, because every button would have an
other description.
So is this possible to realize or must i create lots of pictures? ;-)

Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to include a button which links to a view?

2010-02-11 Thread Jeremy Burns
Something like this:

echo $html->link(
$html->image("recipes/6.jpg", array("alt" => "Brownies")),
"recipes/view/6",
array('escape'=>false)
);

or

echo $html->image("recipes/6.jpg", array(
"alt" => "Brownies",
'url' => array('controller' => 'recipes', 'action' => 'view', 6)
));

See: 
http://book.cakephp.org/view/836/link and
http://book.cakephp.org/view/835/image

Jeremy Burns
jeremybu...@me.com

On 11 Feb 2010, at 09:36, sebb86 wrote:

> Hello,
> 
> how can i create a button in a view, which links to another view? This
> is my code with a simple text link, but how can i this as a button?
> 
> [code]
> 
>  link('add a hardware unit', array('controller'
> => 'hardware_units', 'action' => 'add')) ?>
> [\code]
> 
> Thanks a lot if someone can help!!! :)
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en