I created a helper for my cakephp project. The helper creates a custom input field with a lot of complicated Javascript running at the backend of the input field. I get an error when I try to run my project though.
Code in my DropDownHelper.php file:
class DropDownHelper extends AppHelper {
?>
<!-- JQUERY LOADING -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"></script>
<script>
jQuery.curCSS = jQuery.css;
</script>
<!-- JQUERY LOADING -->
<!-- STYLE SHEET -->
<style>
Some custom styles.
</style>
<!-- STYLE SHEET -->
<!-- SCRIPT -->
<script >
My main Script.
</script>
<!-- SCRIPT -->
<!-- HTML -->
Some HTML
<!-- HTML -->
<?php
}
?>
Part of my Controller:
class PortfoliosController extends AppController {
public $components = array('RequestHandler');
public $helpers = array('DropDown');
And finally, my View:
echo $this->DropDown->input('Clients');
The error says: Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /...../app/View/Helper/DropDownHelper.php on line 34
Lime 34 is Where I close off the php, right before my scripts, css, and html. i.e.
class DropDownHelper extends AppHelper {
?>
Line 34 is the line that says "?>".
Thanks!