<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/hooks</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Mon, 20 May 2013 14:58:01 GMT</pubDate>
<item>
<title>(PHP) Hooks - frontController - phptrampos</title>
<link>http://snipplr.com/view/71017/hooks--frontcontroller/</link>
<description><![CDATA[ <p>Este é um hook que utilizo para evitar de carregar headers e footers em cada view que carrego nos meus projetos. Tem me sido muito útil desde que comecei a utiliza-lo.

O que ele faz? --------

Basicamente a cada chamada ($this->load->view('arquivo');) que faço nos controllers, o hook irá carregar junto 2 outros views um header e um footer (respectivamente os arquivos _header.php e _footer.php na pasta /view). Um antes da minha chamada , no caso o _header, e um depois que a view principal carregar, no caso o _footer.

Como usar? --------

1º - Modifique o arquivo /config/hooks.php com o código informado mais abaixo;

2º - Crie o arquivo frontController.php na pasta /hooks e cole o código informado no Source;

3º - Habilite os hooks no arquivo config.php mudando o parâmetro: $config['enable_hooks'] = TRUE;

4º - Crie 2 arquivos na pasta /application/views/_header.php e _footer.php e os modifique de acordo com o seu site. Colocando o conteúdo de Header (meta tags, styles e javascripts fixos) no arquivo _header.php até a abertura da tag body;

No arquivo _footer.php o fechamento do  e qualquer outro conteúdo que queira deixar fixo no rodapé do seu site.


Chamadas AJAX:
Não se preocupe com as suas chamadas AJAX. Este Hook irá perceber isso e não irá carregar as views.

Se tiver dúvidas, entre em contato comigo pelo email : phptrampos[at]gmail[dot]com</p> ]]></description>
<pubDate>Thu, 02 May 2013 02:48:59 GMT</pubDate>
<guid>http://snipplr.com/view/71017/hooks--frontcontroller/</guid>
</item>
<item>
<title>(Bash) git pre-commit hook print alert - lluis</title>
<link>http://snipplr.com/view/69114/git-precommit-hook-print-alert/</link>
<description><![CDATA[ <p>vim .git/hooks/pre-commit
chmod +x pre-commit

clean print's with
:lvim /print/gj ./**/*.*</p> ]]></description>
<pubDate>Fri, 14 Dec 2012 22:47:36 GMT</pubDate>
<guid>http://snipplr.com/view/69114/git-precommit-hook-print-alert/</guid>
</item>
<item>
<title>(PHP) hook_help: Provide online user help. - LarryTex</title>
<link>http://snipplr.com/view/67317/hookhelp-provide-online-user-help/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 22 Sep 2012 11:14:36 GMT</pubDate>
<guid>http://snipplr.com/view/67317/hookhelp-provide-online-user-help/</guid>
</item>
<item>
<title>(PHP) list_hooked_functions - nerdfiles</title>
<link>http://snipplr.com/view/54565/listhookedfunctions/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sun, 29 May 2011 09:55:56 GMT</pubDate>
<guid>http://snipplr.com/view/54565/listhookedfunctions/</guid>
</item>
<item>
<title>(PHP) Insert Custom Fields Meta - mommygeekology</title>
<link>http://snipplr.com/view/47257/insert-custom-fields-meta/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Mon, 17 Jan 2011 01:42:08 GMT</pubDate>
<guid>http://snipplr.com/view/47257/insert-custom-fields-meta/</guid>
</item>
<item>
<title>(PHP) hook_views_pre_render Drupal 6.x - ReeceMarsland</title>
<link>http://snipplr.com/view/26139/hookviewsprerender-drupal-6x/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 08 Jan 2010 08:54:26 GMT</pubDate>
<guid>http://snipplr.com/view/26139/hookviewsprerender-drupal-6x/</guid>
</item>
<item>
<title>(PHP) hook_views_post_render Drupal 6.x - ReeceMarsland</title>
<link>http://snipplr.com/view/26067/hookviewspostrender-drupal-6x/</link>
<description><![CDATA[ <p>this specifically checks the view name and then checks the arg length altering the page title if its a match</p> ]]></description>
<pubDate>Thu, 07 Jan 2010 07:12:25 GMT</pubDate>
<guid>http://snipplr.com/view/26067/hookviewspostrender-drupal-6x/</guid>
</item>
<item>
<title>(PHP) hook_views_query_alter Drupal 6.x (substring) - ReeceMarsland</title>
<link>http://snipplr.com/view/26066/hookviewsqueryalter-drupal-6x-substring/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 07 Jan 2010 07:09:32 GMT</pubDate>
<guid>http://snipplr.com/view/26066/hookviewsqueryalter-drupal-6x-substring/</guid>
</item>
<item>
<title>(PHP) Highlight Frugal Pro Wordpress Theme Hooks - goaliedave67</title>
<link>http://snipplr.com/view/18520/highlight-frugal-pro-wordpress-theme-hooks/</link>
<description><![CDATA[ <p>HIGHLIGHT THE HOOKS IN FRUGAL PRO  
paste first part into Frugal Pro custom.css
paste second part into Frugal Pro custom_functions.php</p> ]]></description>
<pubDate>Wed, 19 Aug 2009 02:41:45 GMT</pubDate>
<guid>http://snipplr.com/view/18520/highlight-frugal-pro-wordpress-theme-hooks/</guid>
</item>
<item>
<title>(PHP) Assure hooks in a Drupal module are ran before the others. - berkes</title>
<link>http://snipplr.com/view/4449/assure-hooks-in-a-drupal-module-are-ran-before-the-others/</link>
<description><![CDATA[ <p>Sets a module's weight to the lowest number. This assures that your module is ran before all other modules. Userfull if you want your implementation of a hook to be ran first.
Add this to your .install file. Replace your_modulename with the name of your module.</p> ]]></description>
<pubDate>Thu, 03 Jan 2008 10:14:27 GMT</pubDate>
<guid>http://snipplr.com/view/4449/assure-hooks-in-a-drupal-module-are-ran-before-the-others/</guid>
</item>
</channel>
</rss>