Questions tagged [kohana]

HMVC PHP5 framework that provides a set of components for building web applications. Be sure to mention specific version when asking.

Due to the differences in the codebase between and , as well as each minor version, please be specific in detailing which version of Kohana you are using when asking your question.

Kohana is an elegant framework that provides a rich set of components for building web applications.

It requires very little configuration, fully supports and , and provides many of the tools that a developer needs within a highly flexible system. The integrated class auto-loading, cascading filesystem, highly consistent , and easy integration with vendor libraries make it viable for any project, large or small. The support of has been started with

Popular Questions

Resources

See also

2221 questions
10
votes
1 answer

Regex as first line of defense against XSS

I had a regex as the first line of defense against XSS. public static function standard_text($str) { // pL matches letters // pN matches numbers // pZ matches whitespace // pPc matches underscores // pPd matches dashes // pPo…
alex
  • 479,566
  • 201
  • 878
  • 984
10
votes
6 answers

php function foo(array $arg = NULL) -- why the array and NULL?

I've seen the following a few times lately: function foo(array $arg = NULL) { ... } My question being why make the default of $arg NULL when it will be just cast into an array? Why not do: function foo(array $arg = array()) { ... } I know it…
Darryl Hein
  • 142,451
  • 95
  • 218
  • 261
10
votes
3 answers

Kohana3: Different .htaccess rewritebase and kohana base_url for dev and production environment

In my bootstrap.php I have the following: if($_SERVER['SERVER_NAME'] == 'localhost') Kohana::$environment = 'development'; else Kohana::$environment = 'production'; ... switch(Kohana::$environment) { case 'development': …
Svish
  • 152,914
  • 173
  • 462
  • 620
10
votes
2 answers

What is a query offset?

I saw this at the Kohana documentation: $content = new View('pages/items'); $items = new Items_Model; $content->items = $items->get_items($page_no, 10); // page to get starting at offset, number of items to get As you can see, we can assume that…
Ygam
9
votes
6 answers

How to integrate Wordpress into Kohana 3

I now need to make a Kohana 3 site have a Wordpress blog. I've seen Kerkness' Kohana For Wordpress, but it seems to be the opposite of what I want. Here are the options I have thought of Style a template to look exactly like the Kohana site (time…
alex
  • 479,566
  • 201
  • 878
  • 984
9
votes
2 answers

How to arrange business logic in a Kohana 3 project

I'm looking for advice, tutorials and links at how to set up a mid-sized web application with Kohana 3. I have implemented MVC patterns in the past but never worked against a "formalized" MVC framework so I'm still getting my head around the…
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
9
votes
4 answers

Can someone explain Kohana 3's routing system?

In bootstrap.php, where you set routes, I'm having a hard time getting them to work. I read some documentation a while ago that I can't seem to find again that explains them. Here is one of my examples Route::set('products', 'products/(type)',…
alex
  • 479,566
  • 201
  • 878
  • 984
9
votes
6 answers

zend-framework versus Kohana versus Symfony

Which one of this frameworks would you recommend to someone who knows the basics of PHP? What are the advantages and disadvantages?
John
  • 107
  • 1
  • 3
8
votes
4 answers

How To Start Using Kostache?

I just asked a question ( Templates In Kohana 3.1 ) about templates and now I know that I should use Kostache. It's a module for the Mustache template language. Anyway, I just enabled Kostache module for my Kohana 3.1 and all works. It's installed…
daGrevis
  • 21,014
  • 37
  • 100
  • 139
8
votes
2 answers

Smarty and Kohana

Is there a standard "official" way of using Smarty with Kohana 3? I see there are some options that seem less than ideal and will probably break when either Smarty or Kohana's minor version number increases. (as a side question, is it a good idea to…
cambraca
  • 27,014
  • 16
  • 68
  • 99
8
votes
4 answers

What version of Kohana am I using?

Where in the Kohana framework can I find out the version information? Everything I look at in the tutorials opposes to what I view in my application. I believe this to be a version issue as the methods and calls are slightly different between the…
Cem Baykam
  • 507
  • 1
  • 7
  • 20
8
votes
3 answers

How to perform an external request in Kohana 3?

I've always used cURL for this sort of stuff, but this article got me thinking I could request another page easily using the Request object in Kohana 3. $url = 'http://www.example.com'; $update = Request::factory($url); $update->method…
alex
  • 479,566
  • 201
  • 878
  • 984
8
votes
2 answers

Get a random row from a database query in Kohana 3

I'm using the ORM module in Kohana 3 and instead of displaying the first row of a database result set, what query should I use in my code when I want to get a random row from a certain table?
ed.
  • 83
  • 1
  • 4
8
votes
1 answer

Kohana 3.0.x ORM: Read additional columns in pivot tables

I'm using Kohana v3 and ORM, I have two models, Model_A and Model_B related by "has_many" through a pivot table, which has an additional column. I can save data in that column in the pivot table using the third parameter of the add() function, but I…
dusan
  • 9,104
  • 3
  • 35
  • 55
8
votes
6 answers

Where should form validation occur in a MVC project?

I'm using Kohana, but I think this question is more general. I have been doing form validation in the controller, and it has worked well so far. But lately, I've ran into a problem. I have a comments model, and I send comments from a few different…
alex
  • 479,566
  • 201
  • 878
  • 984