Today I face a problem as a beginner of CakePHP …How can I display image button with link in Cake. I wanted to use images as my buttons to edit and delete records and navigate the admin pages.
1. Have to use HTML Helpers Image and Link, and we shall combine this 2. The CakePHP link helper is a handy tool to create links in your application. Here is the basic syntax:
<?php echo $html->link(’help!’,’/help’); ?>
And there’s a helper for creating images, too:
<?php echo $html->image(’add.gif’); ?>
Show HTML code of the image as the link:
<?php echo $html->link($html->image(’add.gif’),’/customers/add’)?>
2. For Image,
$html->image(string $path, array $htmlAttributes, boolean $return = false);
$html->image(’/img/images/cancel.png’, array(’class’ => ’save_button’));
3. For Link, the Syntax:
CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code. Wanna learn CakePHP…..You have to find best sites on it. Given below are some of them:
1. CakeForge: CakeForge is a free service provided to Open Source developers offering easy access to the best in SVN, mailing lists, bug tracking, message boards/forums, task management, site hosting, permanent file archival, full backups, and total web-based administration.