Browse Source

attempt to make animetable usable on search/index and search/anime

raylu 14 năm trước cách đây
mục cha
commit
9111a1e3d0

+ 0 - 4
views/elements/animetable.html.php

@@ -1,5 +1,3 @@
-<?= $this->Paginator->paginate(array('separator' => '')) ?>
-
 <table>
 <th>Title</th>
 <th>Date</th>
@@ -29,5 +27,3 @@
 	</tr>
 <?php endforeach ?>
 </table>
-
-<?= $this->Paginator->paginate(array('separator' => '')) ?>

+ 2 - 2
views/layouts/default.html.php

@@ -62,8 +62,8 @@ use \lithium\security\Auth;
 	';
 	?>
 
-	<?= $this->form->create(null, array('url' => '/search/index/anime', 'class' => 'search', 'method' => 'get')); ?>
-	<?= $this->form->text('search', array('placeholder' => 'Search...')); ?>
+	<?= $this->form->create(null, array('url' => '/search/', 'class' => 'search', 'method' => 'get')); ?>
+	<?= $this->form->text('q', array('placeholder' => 'Search...')); ?>
 	<input type="submit" value="Go">
 	<?= $this->form->end(); ?>
 

+ 5 - 0
views/search/anime.html.php

@@ -7,4 +7,9 @@ $this->styles($this->html->style('pagination'));
 
 <h2>Anime Search Results</h2>
 (search instead for ...)
+
+<?= $this->Paginator->paginate(array('separator' => '')) ?>
+
 <?= $this->_render('element', 'animetable', compact('anime')) ?>
+
+<?= $this->Paginator->paginate(array('separator' => '')) ?>

+ 7 - 36
views/search/index.html.php

@@ -1,41 +1,12 @@
-<?php 
+<?php
 $this->styles($this->html->style('pagination'));
 ?>
 
-<?= var_dump($this->request()->controller); ?>
-
-
-<h3> Anime </h3> 
-<hr>
-<table>
-<th>Title</th>
-<th>Date</th>
-<th>Type</th>
-<?php if(count($anime) > 0): ?>
-<?php foreach ($anime as $item): ?>
-	<tr>
-		<td>
-			<a href="/anime/view/<?= $item->special_id ?>"><?= $item->title ?></a>
-		</td>
-		<td>
-			<?= $item->aired ?>
-		</td>
-		<td>
-			<?= $item->view_type ?>
-		</td>
-	</tr>
-<?php endforeach ?>
-</table>
-<div style = "float:right">
+<h3>Anime</h3>
+<?= $this->_render('element', 'animetable', compact('anime')) ?>
 <?= $this->html->link("More", array('controller' => 'search',
 										'action' => 'anime')); ?>
-</div>
-<?php else: ?>
-<p> No results found</p>
-<?php endif; ?>
-
-
-<h3> Manga </h3> 
+<h3>Manga</h3>
 <hr>
 <table>
 <th>Title</th>
@@ -64,7 +35,7 @@ $this->styles($this->html->style('pagination'));
 <p> No entries found </p>
 <?php endif; ?>
 
-<h3> K Drama </h3> 
+<h3> K Drama </h3>
 <hr>
 <table>
 <th>Title</th>
@@ -90,5 +61,5 @@ $this->styles($this->html->style('pagination'));
 										'action' => 'anime')); ?>
 </div>
 <?php else: ?>
-<p> No Entries found </p>
-<?php endif; ?>
+<p>No Entries found</p>
+<?php endif; ?>