控制器:
公共功能注释视图(){
$allnotes = $this->User->Note->find('all', array('order'=>'Note.created DESC'));
if (!empty($this->params['requested']))
{
return $allnotes;
}
}
看法:
<?php
echo $this->Html->css('notes');
echo $this->Html->script(array('jquery','jquery.elastic','notes'));
?>
<div class="notescontainer">
<div class="share">Share:</div>
<div class="notes">Notes</div>
<div class="loading"></div>
<div class="img_top"></div>
<div class="text_status">
<?php
echo $this->form->create('Note', array('action' => 'notes', 'onSubmit' => 'return loadingicon();'));
echo $this->form->input('notes',array('class'=>'notesbar','label'=>'','placeholder'=>'Write down you notes ...' ));
?>
</div>
<div class="button_outside_border" id="share">
<div class="button_inside_border">
<?php
echo $this->form->submit('Share',array('class' => 'sharebutton'));
echo $this->form->end();
?>
</div>
</div>
<div class="clear"></div>
</div>
<?php
$allnotes = $this->requestAction(array('controller'=>'Users', 'action'=>'notesview'));
foreach($allnotes as $viewnotes):
{
echo "<div class='load_status'>";
echo "<img class='status_img' src="; echo $viewnotes['User']['image']; echo ">";
echo "<div class='status_text'>" ?>
<a href="users/profileview/<?php echo $viewnotes['User']['id']?>" class='blue'>
<?php
echo $viewnotes['User']['name'];
echo "</a>";
echo "<p class='text'>";
echo $viewnotes['Note']['notes'];
echo "</p>";
echo "
<a href='#' class='light_blue'>Like</a> ·
<a href='#' class='light_blue'>Comment</a> · ";
echo "<u class='date'>"; echo $viewnotes['Note']['created']; echo"</u>";
echo $this->element('comments');
echo "</div>";
echo "<div class='clear'></div>";
echo "</div>";
}
endforeach;
?>