<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Рабочие заметки</title>
	<atom:link href="http://juice-biz.ru/feed/" rel="self" type="application/rss+xml" />
	<link>http://juice-biz.ru</link>
	<description>Заметки о информационных технологиях</description>
	<lastBuildDate>Sun, 19 Feb 2012 17:06:28 +0000</lastBuildDate>
	<language>ru-RU</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8.10</generator>
	<item>
		<title>Перезагрузить ipnat</title>
		<link>http://juice-biz.ru/perezagruzit-ipnat/</link>
		<comments>http://juice-biz.ru/perezagruzit-ipnat/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 17:06:28 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Без рубрики]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=283</guid>
		<description><![CDATA[Перезагружаем ipnat c новыми правилами ipnat -CF -f /etc/ipnat.rules]]></description>
				<content:encoded><![CDATA[<p>Перезагружаем ipnat c новыми правилами<br />
ipnat -CF -f /etc/ipnat.rules</p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/perezagruzit-ipnat/feed/</wfw:commentRss>
		<slash:comments>105</slash:comments>
		</item>
		<item>
		<title>MySQL &#8212; как скопировать таблицу?</title>
		<link>http://juice-biz.ru/mysql-kak-skopirovat-tablicu/</link>
		<comments>http://juice-biz.ru/mysql-kak-skopirovat-tablicu/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 11:52:35 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[MYSQL]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=279</guid>
		<description><![CDATA[CREATE TABLE new_table_name LIKE old_table_name; INSERT new_table_name SELECT * FROM old_table_name;]]></description>
				<content:encoded><![CDATA[<p><code>CREATE TABLE new_table_name LIKE old_table_name;<br />
INSERT new_table_name SELECT * FROM old_table_name;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/mysql-kak-skopirovat-tablicu/feed/</wfw:commentRss>
		<slash:comments>95</slash:comments>
		</item>
		<item>
		<title>mysql удалить все записи из таблицы</title>
		<link>http://juice-biz.ru/mysql-udalit-vse-zapisi-iz-tablicy/</link>
		<comments>http://juice-biz.ru/mysql-udalit-vse-zapisi-iz-tablicy/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 05:51:18 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[MYSQL]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=277</guid>
		<description><![CDATA[TRUNCATE TABLE table_name - работает очень быстро, с помощью DELETE можно удалить по условию.]]></description>
				<content:encoded><![CDATA[<p>TRUNCATE TABLE table_name - работает очень быстро, с помощью DELETE можно удалить по условию.</p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/mysql-udalit-vse-zapisi-iz-tablicy/feed/</wfw:commentRss>
		<slash:comments>91</slash:comments>
		</item>
		<item>
		<title>Codeigniter &#8212; создание формы для добавления информации</title>
		<link>http://juice-biz.ru/codeigniter-sozdanie-formy-dlya-dobavleniya-informacii/</link>
		<comments>http://juice-biz.ru/codeigniter-sozdanie-formy-dlya-dobavleniya-informacii/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 17:53:29 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Codeigniter - разработка приложения]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=269</guid>
		<description><![CDATA[На этом уроке мы создадим форму для ввода данных. Будем использовать хелпер Form, это позволит значительно упростить  код и сохранить свое драгоценное время. Для начала, загрузим хелпер Form, для этого добавим в наш контроллер books строчку: $this-&#38;gt;load-&#38;gt;helper&#40;'form'&#41;; &#60;? class Books extends CI_Controller &#123; &#160; function __construct&#40;&#41; &#123; parent::__construct&#40;&#41;; &#125; &#160; function main&#40;&#41;&#123; $this-&#62;load-&#62;model&#40;'books_model'&#41;; $data = [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>На этом уроке мы создадим форму для ввода данных. Будем использовать хелпер Form, это позволит значительно упростить  код и сохранить свое драгоценное время.</p>
<p><span id="more-269"></span>Для начала, загрузим хелпер Form, для этого добавим в наш контроллер books строчку:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>load<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>helper<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'form'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000000; font-weight: bold;">class</span> Books <span style="color: #000000; font-weight: bold;">extends</span> CI_Controller <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">model</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_model'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">books_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">general</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_main_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> input<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'form'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">model</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_model'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">books_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">general</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_input_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Отредактируем файл отображения books_input_view.php, используя функции хелпера.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; 
      href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$base</span>/<span style="color: #006699; font-weight: bold;">$css</span>&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;header&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_header_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&lt;div id=&quot;menu&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_menu_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_open<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books/input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$author</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$publisher</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_input<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'publisher'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$year</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_dropdown<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'year'</span><span style="color: #339933;">,</span><span style="color: #000088;">$years</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$available</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_checkbox<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'available'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'yes'</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$summary</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>: 
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_textarea<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'summary'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/br&gt;
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_submit<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mysubmit'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Submit!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?=</span> form_close<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;div id=&quot;footer&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_footer_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Заметили отличия от обычного HTML? Код действительно стал проще.<br />
Осталось внести некоторые изменения в модель, в частности определить параметры.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>?
<span style="color: #000000; font-weight: bold;">class</span> books_model <span style="color: #000000; font-weight: bold;">extends</span> CI_Model<span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>load<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>helper<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>              
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> general<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>load<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>library<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'base'</span><span style="color: #009900;">&#93;</span>        <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>item<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'base_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#93;</span>        <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>config<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>item<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>show_menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webtitle'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Book Collection'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websubtitle'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'We collect all title of
 books on the world'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webfooter'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'© copyright by step
 by step php tutorial'</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Заголовок'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Автор'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'publisher'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Издательство'</span><span style="color: #339933;">;</span>               
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'year'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Год'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'years'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2007'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'2007'</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'2008'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'2008'</span><span style="color: #339933;">,</span>
 <span style="color: #0000ff;">'2009'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'2009'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'available'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Доступно'</span><span style="color: #339933;">;</span>   
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'summary'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Описание'</span><span style="color: #339933;">;</span>        
&nbsp;
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>   
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Наберите в браузере http://localhost/codeigniter/books/input и увидите результат.<br />
<img src="http://juice-biz.ru/wp-content/uploads/2011/04/step8.jpg" alt="Codeigniter - создание формы" /></p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-sozdanie-formy-dlya-dobavleniya-informacii/feed/</wfw:commentRss>
		<slash:comments>83</slash:comments>
		</item>
		<item>
		<title>Codeigniter &#8212; id последней добавленной записи в БД</title>
		<link>http://juice-biz.ru/codeigniter-id-poslednej-dobavlennoj-zapisi-v-bd/</link>
		<comments>http://juice-biz.ru/codeigniter-id-poslednej-dobavlennoj-zapisi-v-bd/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 06:34:44 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[CodeIgniter]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=266</guid>
		<description><![CDATA[Для получения id последней добавленной записи в БД используем: $this-&#62;CI-&#62;db-&#62;insert_id&#40;&#41;;]]></description>
				<content:encoded><![CDATA[<p>Для получения id последней добавленной записи в БД используем:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CI</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">insert_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-id-poslednej-dobavlennoj-zapisi-v-bd/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>PHP. Длина строки</title>
		<link>http://juice-biz.ru/php-dlina-stroki/</link>
		<comments>http://juice-biz.ru/php-dlina-stroki/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 12:20:27 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=262</guid>
		<description><![CDATA[strlen($str) считает кол-во байт. Для многобайтных кодировок используйте mb_strlen($str).]]></description>
				<content:encoded><![CDATA[<p><span style="color: #000000; font-family: arial; font-size: small;">strlen($str) считает кол-во байт. </span></p>
<p><span style="color: #000000; font-family: arial; font-size: small;">Для многобайтных кодировок используйте mb_strlen($str).<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/php-dlina-stroki/feed/</wfw:commentRss>
		<slash:comments>111</slash:comments>
		</item>
		<item>
		<title>Codeigniter &#8212; добавляем CSS</title>
		<link>http://juice-biz.ru/codeigniter-dobavlyaem-css/</link>
		<comments>http://juice-biz.ru/codeigniter-dobavlyaem-css/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 17:49:07 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Codeigniter - разработка приложения]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=257</guid>
		<description><![CDATA[На прошлом уроке мы говорили о хранение всех часто используемых параметров в одном методе нашей модели. Сейчас мы рассмотрим еще одну возможность централизации на примере добавления таблицы стилей CSS. Выполняйте по пунктам: 1. Для начала укажем общую таблицу стилей CSS в файле config.php, расположенном в папке CodeIgniter\application\config. 2.Добавим следующий код в конец файла $config&#91;'css'&#93; ='mystyles.css'; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>На прошлом уроке мы говорили о хранение всех часто используемых параметров в одном<a title="Codeigniter – централизация данных" href="http://juice-biz.ru/codeigniter-centralizaciya-dannyx/"> методе нашей модели</a>. Сейчас мы рассмотрим еще одну возможность централизации на примере добавления таблицы стилей CSS. Выполняйте по пунктам:<span id="more-257"></span></p>
<p>1. Для начала укажем общую таблицу стилей CSS в файле config.php, расположенном в папке CodeIgniter\application\config.</p>
<p>2.Добавим следующий код в конец файла</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'mystyles.css'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>3.Создадим файл mystyles.css в корне нашего сайта.</p>
<p>4. Для примера, будем использовать следующие стили</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="css" style="font-family:monospace;">h1<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Verdana</span><span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
p<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Georgia</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menu</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menu</span> ul<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#menu</span> li<span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#footer</span><span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Arial</span><span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
 <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>5. В файл модели books_model.php добавим две строчки:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000000; font-weight: bold;">class</span> books_model <span style="color: #000000; font-weight: bold;">extends</span> CI_Model<span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">function</span> general<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'base'</span><span style="color: #009900;">&#93;</span>        <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'base_url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#93;</span>        <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">config</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webtitle'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Коллекция книг'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websubtitle'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'Мы соберем названия всех книг мира'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webfooter'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'2011 - Codeigniter - создание простого приложения'</span><span style="color: #339933;">;</span>    
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>    
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>6. Обновим  файл отображения books_main_view.php, добавив ссылку на таблицу стилей между &lt;head&gt; и &lt;/head&gt;:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&lt;html&gt;
 &lt;head&gt;
 &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$base</span>/<span style="color: #006699; font-weight: bold;">$css</span>&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
 &lt;/head&gt;
 &lt;body&gt;
&nbsp;
 &lt;div id=&quot;header&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_header_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 &lt;div id=&quot;menu&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_menu_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 Список книг
&nbsp;
 &lt;div id=&quot;footer&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_footer_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 &lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>7. Аналогично поступим с файлом books_input_view.php:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&lt;html&gt;
 &lt;head&gt;
 &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$base</span>/<span style="color: #006699; font-weight: bold;">$css</span>&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
 &lt;/head&gt;
 &lt;body&gt;
&nbsp;
 &lt;div id=&quot;header&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_header_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 &lt;div id=&quot;menu&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_menu_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 Ввод данных о книге
&nbsp;
 &lt;div id=&quot;footer&quot;&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_footer_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/div&gt;
&nbsp;
 &lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Полюбуемся на результат:</p>
<div id="attachment_258" style="width: 500px" class="wp-caption alignnone"><a href="http://juice-biz.ru/wp-content/uploads/2011/04/step7.jpg"><img class="size-full wp-image-258" title="step7" src="http://juice-biz.ru/wp-content/uploads/2011/04/step7.jpg" alt="Codeiniter - использование таблицы стилей CSS" width="490" height="288" /></a><p class="wp-caption-text">Codeiniter - использование таблицы стилей CSS</p></div>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-dobavlyaem-css/feed/</wfw:commentRss>
		<slash:comments>78</slash:comments>
		</item>
		<item>
		<title>Codeigniter &#8212; централизация данных</title>
		<link>http://juice-biz.ru/codeigniter-centralizaciya-dannyx/</link>
		<comments>http://juice-biz.ru/codeigniter-centralizaciya-dannyx/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 08:17:40 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Codeigniter - разработка приложения]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=252</guid>
		<description><![CDATA[На предыдущем уроке мы написали код, в котором в каждой функции контроллера вызывалась библиотека меню. Это не очень практично, так как пришлось копипастить один и тот же код. Мы может централизовать информацию, которую нужно выводить на всех страницах нашего приложения. В частности, это шапка сайта и подвал. Эти данные разместим в нашей моделе. Для начала, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>На предыдущем уроке мы написали код, в котором в каждой <a title="Codeigniter – добавление информации в шапку и подвал сайта" href="http://juice-biz.ru/codeigniter-dobavlenie-informacii-v-shapku-i-podval-sajta/">функции контроллера</a> вызывалась библиотека меню. Это не очень практично, так как пришлось копипастить один и тот же код. Мы может централизовать информацию, которую нужно выводить на всех страницах нашего приложения. В частности, это шапка сайта и подвал. Эти данные разместим в нашей моделе.<span id="more-252"></span></p>
<p>Для начала, добавим новую функцию general() в модель. Обновите код в файле books_model.php.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000000; font-weight: bold;">class</span> books_model <span style="color: #000000; font-weight: bold;">extends</span> CI_Model<span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>               
 <span style="color: #009900;">&#125;</span>
 <span style="color: #000000; font-weight: bold;">function</span> general<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span>         <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webtitle'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Коллекция книг'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websubtitle'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'Мы соберем названия всех книг мира'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webfooter'</span><span style="color: #009900;">&#93;</span>    <span style="color: #339933;">=</span> <span style="color: #0000ff;">'2011 - Codeigniter - создание простого приложения'</span><span style="color: #339933;">;</span>   
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>   
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>И уберем из контролера дублирующую информацию:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000000; font-weight: bold;">class</span> Books <span style="color: #000000; font-weight: bold;">extends</span> CI_Controller <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">model</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_model'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">books_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">general</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_main_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> input<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">books_model</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">general</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_input_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-centralizaciya-dannyx/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>Codeigniter &#8212; добавление информации в шапку и подвал сайта</title>
		<link>http://juice-biz.ru/codeigniter-dobavlenie-informacii-v-shapku-i-podval-sajta/</link>
		<comments>http://juice-biz.ru/codeigniter-dobavlenie-informacii-v-shapku-i-podval-sajta/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 05:40:36 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Codeigniter - разработка приложения]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=238</guid>
		<description><![CDATA[На прошлом уроке мы создали меню для сайта. На этом уроке добавим текст в шапку и подвал сайта. Обновите код в контроллере books.php. &#60;? class Books extends CI_Controller &#123; &#160; function __construct&#40;&#41; &#123; parent::__construct&#40;&#41;; &#125; &#160; function main&#40;&#41;&#123; $this-&#62;load-&#62;library&#40;'MyMenu'&#41;; $menu = new MyMenu; $data&#91;'menu'&#93; = $menu-&#62;show_menu&#40;&#41;; $data&#91;'webtitle'&#93; = 'Коллекция книг'; $data&#91;'websubtitle'&#93; = 'Мы соберем названия [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>На прошлом уроке мы создали <a title="Codeigniter – создание библиотеки меню" href="http://juice-biz.ru/codeigniter-sozdanie-biblioteki-menyu/">меню для сайта</a>. На этом уроке добавим текст в шапку и подвал сайта.<span id="more-238"></span></p>
<p>Обновите код в контроллере books.php.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #000000; font-weight: bold;">class</span> Books <span style="color: #000000; font-weight: bold;">extends</span> CI_Controller <span style="color: #009900;">&#123;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
 parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span> 		<span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webtitle'</span><span style="color: #009900;">&#93;</span>   <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Коллекция книг'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websubtitle'</span><span style="color: #009900;">&#93;</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Мы соберем названия всех книг мира'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webfooter'</span><span style="color: #009900;">&#93;</span>	<span style="color: #339933;">=</span> <span style="color: #0000ff;">'2011 - Codeigniter - создание простого приложения'</span><span style="color: #339933;">;</span>				
&nbsp;
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_main_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">function</span> input<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span>             <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webtitle'</span><span style="color: #009900;">&#93;</span>	      <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Коллекция книг'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'websubtitle'</span><span style="color: #009900;">&#93;</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Мы соберем названия всех книг мира'</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'webfooter'</span><span style="color: #009900;">&#93;</span>	<span style="color: #339933;">=</span> <span style="color: #0000ff;">'2011 - Codeigniter - создание простого приложения'</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_input_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Затем обновите файл books_header_view:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&lt;h1 id=&quot;title&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$webtitle</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/h1&gt;
&lt;h2&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$websubtitle</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/h2&gt;</pre></td></tr></table></div>

<p>и books_footer_view.php:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$webfooter</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Результат должен быть таким:</p>
<p><a href="http://juice-biz.ru/wp-content/uploads/2011/04/step5.jpg"><img class="alignnone size-full wp-image-249" title="step5" src="http://juice-biz.ru/wp-content/uploads/2011/04/step5.jpg" alt="" width="461" height="269" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-dobavlenie-informacii-v-shapku-i-podval-sajta/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Codeigniter – создание библиотеки меню</title>
		<link>http://juice-biz.ru/codeigniter-sozdanie-biblioteki-menyu/</link>
		<comments>http://juice-biz.ru/codeigniter-sozdanie-biblioteki-menyu/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 08:55:44 +0000</pubDate>
		<dc:creator><![CDATA[juice_biz]]></dc:creator>
				<category><![CDATA[Codeigniter - разработка приложения]]></category>

		<guid isPermaLink="false">http://juice-biz.ru/?p=220</guid>
		<description><![CDATA[В прошлом уроке мы создали слои для нашего приложения. В этом поговорим о библиотеке. Для практики создадим библиотеку для нашего меню. Для начала создайте файл MyMenu.php и положите его в папку Codeigniter\system\application\libraries. Введите следующий код: &#60;?php class MyMenu&#123; function show_menu&#40;&#41;&#123;             $obj =&#38; get_instance&#40;&#41;; $obj-&#62;load-&#62;helper&#40;'url'&#41;;             $menu  = &#34;&#60;ul&#62;&#34;; $menu .= &#34;&#60;li&#62;&#34;;             $menu .= anchor&#40;&#34;books/main&#34;,&#34;Список книг&#34;&#41;; $menu [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>В прошлом уроке мы создали <a title="Codeigniter – создание  слоев" href="http://juice-biz.ru/codeigniter-sozdanie-sloev/">слои для нашего приложения</a>. В этом поговорим о библиотеке. Для практики создадим библиотеку для нашего меню.<span id="more-220"></span></p>
<p>Для начала создайте файл MyMenu.php и положите его в папку Codeigniter\system\application\libraries. Введите следующий код:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> MyMenu<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">function</span> show_menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$obj</span> <span style="color: #339933;">=&amp;</span> get_instance<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$obj</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">helper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu </span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;ul&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> anchor<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;books/main&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Список книг&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> anchor<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;books/input&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Ввод данных&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/li&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/ul&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Для создания библиотеки меню нам потребуется новый класс, назовем его «MyMenu». В нем есть функция для отображения меню show_menu(). В этой функции получаем доступ к ресурсам Фреймворка и загружаем хелпер URL. URL хелпер нужен для простого создания ссылок.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">anchor<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;books/input&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Список книг&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #666666; font-style: italic;">// эквивалент строки</span>
<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://localhost/CodeIgniter/index.php/books/input&quot;</span><span style="color: #339933;">&gt;</span>Список книг<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>В меню мы используем список &lt;ul&gt;. Внешний вид меню мы изменим в следующем уроке, когда будем подключать таблицу стилей.</p>
<p>Откроем контроллер books.php из папки Codeigniter\system\application\controllers и обновим код.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> Books <span style="color: #000000; font-weight: bold;">extends</span> CI_Controller <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
           parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
           <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
           <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_main_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> input<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'MyMenu'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$menu</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyMenu<span style="color: #339933;">;</span>
            <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">show_menu</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'books_input_view'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Внесите изменения в файл books_menu_view.php</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$menu</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Наберите в браузере <a href="http://localhost/codeigniter/index.php/books/main">http://localhost/codeigniter/index.php/books/main</a> и увидите следующую картину:</p>
<p><a href="http://juice-biz.ru/wp-content/uploads/2011/04/step4.jpg"><img class="alignnone size-full wp-image-231" title="step4" src="http://juice-biz.ru/wp-content/uploads/2011/04/step4.jpg" alt="" width="493" height="231" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://juice-biz.ru/codeigniter-sozdanie-biblioteki-menyu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 3.114 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2015-09-07 05:43:32 -->
