Skip to content


Unofficial Kohana 3.0 Wiki

I invite everyone to check out the Unofficial Kohana 3.0 Wiki.

Unofficial Kohana 3.0 Wiki

The purpose of this Wiki is to provide a place where the Kohana community can collaborate on documentation and tutorials and to provide a staging ground for writing official documentation.

Posted in Code.


Kohana for Wordpress RC1 Usage Examples

Now that Kohana version 3.0 has reached a release candiate version I have also moved the Kohana-For-Wordpress plugin into a RC1 status and thought it would be useful to post some usage examples. Click here to download the plugin

There are five ways which you can call a Kohana controller from wordpress

1 – Use wordpress permalinks, .htaccess and Kohana default routing

2 – Use wordpress dashboard to bind kohana controllers to wordpress pages

3 – Use a template tag to call a controller from your wordpress templates

4 – Use a shortcut tag to call a controller from within a wordpress post or page

5 – Add a KohanaWidget to your wordpress sidebar

Using Permalinks and Default Routing

Follow the Wordpress instructions to set up permalinks for your blog. I use a custom permalink structure of /%postname%/ which works well.  If you do this then you can also call any valid Kohana controller as long as the controller name does not conflict with your post name.

For example. If you have the following Kohana controller in application/classes/controller/mycontroller you’ll be able to call this controller from the url http:/myblogurl.com/mycontroller.

Important things to remember: You’re controller will be loaded as if it is the content of a wordpress page. The page content will be whatever you set as your controller response. The title of the page however is taken from the wordpress database by default.  To set the title of your page with your Kohana controller you must update the ‘title’ property of the Kohana request object as shown below

$this->request->title = “My Page Title”;

Bind a Kohana Controller to a Wordpress Page

If you go to the Settings > Kohana section of your wordpress dashboard you’ll have the ability to set some custom page routing.  Simply enter the Kohana controller ( controller/action/id )  in the appropriate input field and select a wordpress page from the dropdown menu.  You also have the option to set the desired placement of the controller’s response.

Calling a Kohana Controller from a Wordpress Template

From any wordpress template or theme file you have the option of calling a Kohana Controller using the following syntax

<?php kohana(’controller/action/id’); ?>

Using a Shortcut tag to call a Kohana Controller from a Post or Page

If you want to call a Kohana Controller directly from a Wordpress post or page just use the following syntax when editing your content

[ request controller/action/id ]

Add a KohanaWidget to your Wordpress Sidebar

From the Apperance > Widget section of your dashboard add the KohanaWidget to your sidebar and provide a title and the controller you wish to call ( example  controller/action/id )

Questions and Support

For more support and to get answers to your questions head to http://forum.kohanaphp.com

Posted in Code.


CatsWhoCode.com: 15 PHP regular expressions for web developers

On CatsWhoCode.com today there’s a new article listing fifteen handy regular expressions you might find useful in your day-to-day development (as well as a brief introduction to what regular expressions are).

Regular expressions are a very useful tool for developers. They allow to find, identify or replace text, words or any kind of characters. In this article, I have compiled 15+ extremely useful regular expressions that any web developer should have in his toolkit.

Here’s just some of the expressions on the list:

  • Enlight a word from a text
  • Remove repeated words (case insensitive)
  • Matching a XML/HTML tag
  • Matching hexadecimal color values
  • Parsing Apache logs

Posted in PHP.


Developer.com: Performance Improvements: Caching

While not specifically related to caching in PHP applications, this recent post from developer.com has some good reminders of how much the right kind of caching can help your application to really fly.

If you’re looking at performance and you want to get some quick wins, the obvious place to start is caching. Caching as a concept is focused exclusively around improving performance. [...] Fundamentally caching has one limitation – managing updates – and several decisions. In this article, we’ll explore the basic options for caching and their impact on performance.

They talk about three different update methods – a synchronized update, lazy update and a read-through strategy (where the caching functionality itself can force a re-read of the original source). There’s also a brief look at options to consider when caching data and how you’re going to manage that cache once you’ve filled it with data.

Posted in PHP.


Job Posting: Banis & Associates (Recruiter) Seeks Tech Lead (Southeast US)

Company Banis & Associates (Recruiter)
Location Southeast US
Title Tech Lead
Summary

Company:

Our client, headquartered in the Southeast, is an online marketing services company that acquires new customers on behalf of brands in a variety of vertical markets, ranging from home and business services to education and automotive. Capabilities include lead generation, sales conversion, performance tracking and marketing channel optimization. Founded in 2000, the company has six offices and more than 500 employees.

Responsibilities:

Provide PHP programming and functionality for a wide variety of consumer related websites, intranets, extranets, and web-based applications.

Collaborate with business leaders to understand technology needs and requirements and lead a small team of developers.

Be challenged on a daily basis to solve problems in new and creative ways.

Design, evaluate, update, and maintain object oriented applications in PHP.

Share your opinions and insights with business leaders on a daily basis in order to affect rapid decision cycles and effective solutions to business requirements.

Translate vague business requirements into tangible and accurate technical requirements as well as anticipate future requirements within the design of new systems.

Requirements:

  • Bachelor’s degree in Information Sciences or similar field.
  • 5+ years of solid PHP and MySQL development.
  • Strong working knowledge of HTML, DHTML/CSS and Javascript.
  • The ability to translate business requirements into system design.
  • Successful track record of working in a fast-paced, collaborative team environment.
  • Exceptional debugging skills and the ability to easily and quickly read and modify existing code.
  • Ability to effectively communicate with business leaders and marketing managers.
  • Desire to take an active role in the success of the business unit.
  • Genuine interest in our business and in creating technologies to enable its success.
  • Sense of humor

Further information can be obtained by contacting:

Jeanne Boyce – Banis & Associates

at 815-468-0150 or jmboyce@sbcglobal.net

All inquiries are kept on a strictly confidential basis.

Posted in PHP.


NETTUTS.com: CodeIgniter From Scratch: Day 2

NETTUTS.com has posted Day 2 of their “CodeIgniter from Scratch” series of vidcasts following up on the first day.

Continuing on from day 1, today, I’ll teach you five different ways to write select statements for your database. If you haven’t watched the first entry in this video series, don’t worry; each video can function on its own as a single tutorial. Having said that, I highly recommend that you watch each screencast.

You can watch the vidcast through their in-page player or just grab the source code for their examples and get to work.

Posted in PHP.


IBM developerWorks: MVC with Agavi – Add forms and database support with Agavi and Doctrine

The second part of the IBM developerWorks series looking at the Agavi PHP framework has been posted. In it Vikram Vaswani loks at adding forms and database support to his example via Doctrine.

While Agavi can certainly be used to serve up static content, it really shines when you use it for something more complex. And in this second part, you’ll do just that – over the next few pages, you’ll learn how to receive, validate, and process input from Web forms, as well as connect your Agavi application to a MySQL database.

He returns to his simple templated example site and shows how to use the command line agavi tool to create the routing and controller to handle the “contact us” requests. He includes form validation examples, how to use the population filter, and how to generate the Doctrine models to connect with the form directly.

Posted in PHP.


Community News: Latest PECL Releases for 07.28.2009

Latest PECL Releases:

Posted in PHP.


php|architect Blog: Professional Programming: DTAP – Part 2 : Other moving Pieces

The php|architect blog has posted the second part of Cal Evans’ series looking at the typical lifecycle of a project – Development, Testing, Acceptance and Production.

In the previous part of this series, we discussed the main pieces needed for a proper development environment. However, there are other, smaller pieces, scripts, subsystems and other very important components of a properly-configured development environment that don’t fit in the acronym.

This second part of the series looks at the “T” in DTAP – testing. It mentions unit testing, integration testing and regression testing. He also touches briefly on “refresh scripts” to handle data updates or pushes out to another stage of the process.

Posted in PHP.


DevShed: PHP 5 Helpers: Calling Methods Out of Object Scope

In this new tutorial from DevShed today they continue their series looking at making helper classes for your applications. This time they’re focusing on using methods without needing to create an object first – static methods.

The methods of the class that I [just] mentioned were declared implicitly dynamic, even though it’s perfectly possible to call them statically, and the PHP engine won’t raise any errors about this process. However, it would be much better to declare these methods explicitly static, thus taking advantage of the functionality offered by the text helper class without having to spawn an instance of it.

They show how to define the methods with the “static” keyword so they can be called outside of the class’ scope. Code for the helper class and the code to put it to use.

Posted in PHP.




close