Skip to content

Instantly share code, notes, and snippets.

@suissa
Created January 17, 2012 17:02
Show Gist options
  • Save suissa/1627505 to your computer and use it in GitHub Desktop.
Save suissa/1627505 to your computer and use it in GitHub Desktop.
Uma view do cakephp, problemas com yepnope
<?php
echo $this->Html->script('yepnope.js');
?>
<script type="text/javascript">
var baseUrl = '<?php echo Router::url('/', true) ?>';
yepnope({
load: '//ajax.googleapis.com/ajax/libs/jquery/1.7/jquerywww.min.js',
callback: function (url, result, key) {
if (!window.jQuery){
yepnope(baseUrl+'js/jquery.min.js');
alert('local');
}
},
complete: function() {
$ = jQuery;
//Coloque seu code jQuery aqui!!!!
$(document).ready(function() {
alert('completo');
});
}
});
</script>
<?php
$__controller = "profile";
$__action = "save";
if(isset($result)):
echo "<h1>".$result['Profile']['id']." - ".$result['Profile']['name']."</h1>";
endif; ?>
<?php
//$this->extend('form.ctp');
if(isset($results)): ?>
<table>
<tr>
<th>Id</th>
<th>Profile</th>
</tr>
<?php foreach ($results as $result): ?>
<tr>
<td><?php echo $result['Profile']['id']; ?></td>
<td>
<?php echo $this->Html->link($result['Profile']['name'], array('controller' => 'profile', 'action' => 'view', $result['Profile']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment