<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Комментарии: Модуль Pagination</title>
	<atom:link href="http://kohanaframework.su/modules/pagination/feed" rel="self" type="application/rss+xml" />
	<link>http://kohanaframework.su</link>
	<description>Документация и обучение фреймворку Kohana v3.2</description>
	<lastBuildDate>Tue, 04 Aug 2015 19:12:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Автор: Kiz</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1537</link>
		<dc:creator>Kiz</dc:creator>
		<pubDate>Wed, 30 Jan 2013 00:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1537</guid>
		<description>А подскажите какой роут у вас используется на http://kohanaframework.su/kohana/articles для articles? 

а то не могу никак сообразить, как вы сделали так, что бы по 
http://kohanaframework.su/kohana/articles/2 - были страницы, а по 
http://kohanaframework.su/kohana/articles/articlе2 - была статья.

Спасибо.</description>
		<content:encoded><![CDATA[<p>А подскажите какой роут у вас используется на <a href="http://kohanaframework.su/kohana/articles" rel="nofollow">http://kohanaframework.su/kohana/articles</a> для articles? </p>
<p>а то не могу никак сообразить, как вы сделали так, что бы по<br />
<a href="http://kohanaframework.su/kohana/articles/2" rel="nofollow">http://kohanaframework.su/kohana/articles/2</a> &#8212; были страницы, а по<br />
<a href="http://kohanaframework.su/kohana/articles/articlе2" rel="nofollow">http://kohanaframework.su/kohana/articles/articlе2</a> &#8212; была статья.</p>
<p>Спасибо.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: pavel_martin</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1441</link>
		<dc:creator>pavel_martin</dc:creator>
		<pubDate>Fri, 09 Nov 2012 18:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1441</guid>
		<description>Я так и сделал. Но не работает :( Странно</description>
		<content:encoded><![CDATA[<p>Я так и сделал. Но не работает <img src='http://kohanaframework.su/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Странно</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Денис Васильевич</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1440</link>
		<dc:creator>Денис Васильевич</dc:creator>
		<pubDate>Fri, 09 Nov 2012 14:58:12 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1440</guid>
		<description>Для формирования ссылок вида /2 нужно параметр
&lt;pre lang=&quot;php&quot;&gt;
&#039;current_page&#039; =&gt; array(&#039;source&#039; =&gt; &#039;query_string&#039;, &#039;key&#039; =&gt; &#039;page&#039;), // source: &quot;query_string&quot; or &quot;route&quot;
&lt;/pre&gt;

поменять на

&lt;pre lang=&quot;php&quot;&gt;
&#039;current_page&#039; =&gt; array(&#039;source&#039; =&gt; &#039;route&#039;, &#039;key&#039; =&gt; &#039;page&#039;), // source: &quot;query_string&quot; or &quot;route&quot;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Для формирования ссылок вида /2 нужно параметр</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'current_page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'source'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'query_string'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// source: &quot;query_string&quot; or &quot;route&quot;</span></pre></div></div>

<p>поменять на</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'current_page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'source'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'route'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'key'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// source: &quot;query_string&quot; or &quot;route&quot;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>Автор: pavel_martin</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1439</link>
		<dc:creator>pavel_martin</dc:creator>
		<pubDate>Fri, 09 Nov 2012 14:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1439</guid>
		<description>Добрый день! 
Возникла проблема с пагинатоом.

Есть роут
Route::set(&#039;static&#039;, &#039;(/)&#039;, array(&#039;action&#039; =&gt; &#039;index&#124;about&#124;contacts&#124;showpages&#039;))
		-&gt;defaults(array(
				&#039;controller&#039; =&gt; &#039;static&#039;,
				));	

За отображение пагинатора отвечает метод showpages контроллера static

public function action_showpages()
	{
		$content = &#039;&#039;;
	$objects = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
		
	$pag_data = array
			(
				
				&#039;total_items&#039;        =&gt; count($objects),
				&#039;items_per_page&#039;  =&gt; 3,
				&#039;view&#039; =&gt; &#039;pagination/mypager&#039;,
				&#039;first_page_in_url&#039; =&gt; true,
				);
		
		$content = Pagination::factory($pag_data)-&gt;route_params( array(
			&#039;controller&#039; =&gt; Request::current()-&gt;controller(),
			&#039;action&#039; =&gt; Request::current()-&gt;action(),
			))-&gt;render();


		$this-&gt;template-&gt;content = $content;
	}

Этот пример работает, но работает с использованием параметра ?page. Пагинатор генерирует ссылки типа kohana/showpages/?page=2

Я хочу использовать роут для приведения ссылок пагинатора к типу kohana/showpages/2

ДЛя этого я добавил в $pag_data 

&#039;current_page&#039; =&gt; array(&#039;source&#039; =&gt; &#039;route&#039;, &#039;key&#039; =&gt; &#039;page&#039;),
и создал роут 
Route::set(&#039;pagination&#039;, &#039;(/)&#039;, array(&#039;page&#039; =&gt; &#039;[0-9]+&#039;))
		-&gt;defaults(array(
				&#039;controller&#039; =&gt; &#039;static&#039;,
				&#039;action&#039;     =&gt; &#039;showpages&#039;,
				));

Но пагинатор для всех ссылок генерирует kohana/showpages

Что я сделал не так?</description>
		<content:encoded><![CDATA[<p>Добрый день!<br />
Возникла проблема с пагинатоом.</p>
<p>Есть роут<br />
Route::set(&#8216;static&#8217;, &#8216;(/)&#8217;, array(&#8216;action&#8217; =&gt; &#8216;index|about|contacts|showpages&#8217;))<br />
		-&gt;defaults(array(<br />
				&#8216;controller&#8217; =&gt; &#8216;static&#8217;,<br />
				));	</p>
<p>За отображение пагинатора отвечает метод showpages контроллера static</p>
<p>public function action_showpages()<br />
	{<br />
		$content = &#187;;<br />
	$objects = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);</p>
<p>	$pag_data = array<br />
			(</p>
<p>				&#8216;total_items&#8217;        =&gt; count($objects),<br />
				&#8216;items_per_page&#8217;  =&gt; 3,<br />
				&#8216;view&#8217; =&gt; &#8216;pagination/mypager&#8217;,<br />
				&#8216;first_page_in_url&#8217; =&gt; true,<br />
				);</p>
<p>		$content = Pagination::factory($pag_data)-&gt;route_params( array(<br />
			&#8216;controller&#8217; =&gt; Request::current()-&gt;controller(),<br />
			&#8216;action&#8217; =&gt; Request::current()-&gt;action(),<br />
			))-&gt;render();</p>
<p>		$this-&gt;template-&gt;content = $content;<br />
	}</p>
<p>Этот пример работает, но работает с использованием параметра ?page. Пагинатор генерирует ссылки типа kohana/showpages/?page=2</p>
<p>Я хочу использовать роут для приведения ссылок пагинатора к типу kohana/showpages/2</p>
<p>ДЛя этого я добавил в $pag_data </p>
<p>&#8216;current_page&#8217; =&gt; array(&#8216;source&#8217; =&gt; &#8216;route&#8217;, &#8216;key&#8217; =&gt; &#8216;page&#8217;),<br />
и создал роут<br />
Route::set(&#8216;pagination&#8217;, &#8216;(/)&#8217;, array(&#8216;page&#8217; =&gt; &#8216;[0-9]+&#8217;))<br />
		-&gt;defaults(array(<br />
				&#8216;controller&#8217; =&gt; &#8216;static&#8217;,<br />
				&#8216;action&#8217;     =&gt; &#8216;showpages&#8217;,<br />
				));</p>
<p>Но пагинатор для всех ссылок генерирует kohana/showpages</p>
<p>Что я сделал не так?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: poter</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1364</link>
		<dc:creator>poter</dc:creator>
		<pubDate>Thu, 18 Oct 2012 19:38:47 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1364</guid>
		<description>Уесли вручную вбиваю адрес, то все корректно работает</description>
		<content:encoded><![CDATA[<p>Уесли вручную вбиваю адрес, то все корректно работает</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: poter</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1363</link>
		<dc:creator>poter</dc:creator>
		<pubDate>Thu, 18 Oct 2012 19:29:47 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1363</guid>
		<description>Добрый вечер, все сделал по инструкции, но все ссылки в пагинаторе ведут на домашнюю страницу сайта, а именно на http://site.ru/ , имею ввиду на мой домен все ссылки идут, что делать, в чем может быть проблема ?</description>
		<content:encoded><![CDATA[<p>Добрый вечер, все сделал по инструкции, но все ссылки в пагинаторе ведут на домашнюю страницу сайта, а именно на <a href="http://site.ru/" rel="nofollow">http://site.ru/</a> , имею ввиду на мой домен все ссылки идут, что делать, в чем может быть проблема ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: limurec</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1334</link>
		<dc:creator>limurec</dc:creator>
		<pubDate>Sat, 13 Oct 2012 10:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1334</guid>
		<description>Спасибо! Решение оказалось проще простого...я тут вверху писал что пришлось передавать параметры...вот
$pagination = Pagination::factory(array(
‘total_items’ =&gt; $count,
))
-&gt;route_params(array(
‘controller’ =&gt; Request::current()-&gt;controller(),
‘action’ =&gt; Request::current()-&gt;action(),
и просто добавил сюда еще параметр &#039;cat&#039; =&gt; $this-&gt;request-&gt;param(&#039;cat&#039;);
));
теперь все ОК!))</description>
		<content:encoded><![CDATA[<p>Спасибо! Решение оказалось проще простого&#8230;я тут вверху писал что пришлось передавать параметры&#8230;вот<br />
$pagination = Pagination::factory(array(<br />
‘total_items’ =&gt; $count,<br />
))<br />
-&gt;route_params(array(<br />
‘controller’ =&gt; Request::current()-&gt;controller(),<br />
‘action’ =&gt; Request::current()-&gt;action(),<br />
и просто добавил сюда еще параметр &#8216;cat&#8217; =&gt; $this-&gt;request-&gt;param(&#8216;cat&#8217;);<br />
));<br />
теперь все ОК!))</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Денис Васильевич</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1333</link>
		<dc:creator>Денис Васильевич</dc:creator>
		<pubDate>Sat, 13 Oct 2012 10:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1333</guid>
		<description>Ну это я с одного из своих скопировал. А что, роут в статье не подходит ? 
&lt;pre lang=&quot;php&quot;&gt;
Route::set(&#039;category&#039;, &#039;category(/&lt;id&gt;-&lt;catname&gt;(/&lt;page&gt;))&#039;, array(&#039;id&#039; =&gt; &#039;[0-9]+&#039;), array(&#039;page&#039; =&gt; &#039;[0-9]+&#039;))
        -&gt;defaults(array(
            &#039;controller&#039; =&gt; &#039;category&#039;,
            &#039;action&#039;     =&gt; &#039;index&#039;,
        ));
&lt;/pre&gt;

Он как раз формирует пагинатор по категориям на этом сайте http://www.host4pics.ru</description>
		<content:encoded><![CDATA[<p>Ну это я с одного из своих скопировал. А что, роут в статье не подходит ?</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Route<span style="color: #339933;">::</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'category(/&lt;id&gt;-&lt;catname&gt;(/&lt;page&gt;))'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'[0-9]+'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'[0-9]+'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">-&gt;</span><span style="color: #004000;">defaults</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'category'</span><span style="color: #339933;">,</span>
            <span style="color: #0000ff;">'action'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'index'</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Он как раз формирует пагинатор по категориям на этом сайте <a href="http://www.host4pics.ru" rel="nofollow">http://www.host4pics.ru</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: limurec</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1332</link>
		<dc:creator>limurec</dc:creator>
		<pubDate>Sat, 13 Oct 2012 10:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1332</guid>
		<description>Не то...(( Я на форуме сейчас все подробно опишу...может кто еще подскажет.</description>
		<content:encoded><![CDATA[<p>Не то&#8230;(( Я на форуме сейчас все подробно опишу&#8230;может кто еще подскажет.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Денис Васильевич</title>
		<link>http://kohanaframework.su/modules/pagination/comment-page-2#comment-1331</link>
		<dc:creator>Денис Васильевич</dc:creator>
		<pubDate>Sat, 13 Oct 2012 10:04:23 +0000</pubDate>
		<guid isPermaLink="false">http://kohanaframework.su/?page_id=881#comment-1331</guid>
		<description>&lt;pre lang=&quot;php&quot;&gt;
Route::set(&#039;category_page&#039;, &#039;(&lt;path&gt;/)(page/&lt;page&gt;)&#039;,  array(&#039;path&#039; =&gt; &#039;.+&#039;, &#039;page&#039; =&gt; &#039;[0-9]+&#039;))
    -&gt;defaults(array(
    &#039;controller&#039; =&gt; &#039;main&#039;,
    &#039;action&#039;     =&gt; &#039;index&#039;,
));
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">Route<span style="color: #339933;">::</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category_page'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'(&lt;path&gt;/)(page/&lt;page&gt;)'</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'path'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'.+'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'[0-9]+'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">-&gt;</span><span style="color: #004000;">defaults</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'main'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'action'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'index'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>
