kohana

kohana deployment

hi everyone I am deploying my site, using kohana, this is the testing site -localhost/koh and i use htaccess to remove the index. I am able to successfully put it in something like www.site.com/koh but i am struggling to place it on the root folder, and making it work with htaccess, or how do i make it work, by placing index in root an...

More efficient access to an multi-dim array

I'm trying to nicely output a data array (with Kohana v2.3.4), and am thinking there has to be a more efficient and elegant way to do this. My array looks like this: array('category_id' => value, 'category_title' => value, 'posts' => array( 'id' => value, 'title' => value, ... )) And here's how I'm outputting it in my view (some arr...

Kohana 2.3.4 ORM update question

I'm trying to update a record using the ORM library built in to Kohana 2.3.4. I'm basically modifying the script I use to insert the record in the first place. My problem is the record is getting inserted again, not updated. Here's my script: public function edit($id) { // Find the selected blog entry $blog = ORM::factory('...

CodeIgniter vs Kohana

I've never used either before. I'm not a pro php programmer, but want to be. I like "state of the art" tools and code. Is there any reason I shouldn't go for Kohana? I noticed there were not books on amazon about kohana. Input is appreciated! ...

Kohana event system in Erlang?

I want to implant a framework in Erlang that is similar to Kohana event system. Anyone know how to do that or have any idea? I really like how Kohana is structured. EDIT The Kohana event system have been documented here : http://docs.kohanaphp.com/general/events . If I understand it correctly, I can replicate Kohana in Erlang like this...

Fastest / Easiest method to develop a multi-user gaming engine in PHP/MySQL?

Hi, I'm an advanced designer, but also starting out a career in development: I'm a PHP intermediate user. I (unfortunately) learnt procedural development, and not OOP. My current project is a multi-user game web-app and I was developing procedurally only for my Boss to insist that it has to be OOP, so I needed to start learning OOP (I b...

PHP Chart Library Solution

Hello. Good day. I am a newbie to PHP framework, and I know a little about CI. Recently, i plan to start my new practice project with Kohana. I am looking for a good PHP Chart Solution. Requirement: Free chart library is better; Integrated with Kohana well. Could you give me suggestion about it. Thank you for your reply here. ...

PHPUnit - test MVC controller with $_POST variable

I'm starting work with PHPUnit with Kohana. My application have many controllers which simply takes data from some form, validates and inserts/updates/deletes into/-/from database. How should I write a test cases for that. I know that if I want to test a function I write data provider function and just compare returned value with the ex...

Passing extra paramaters via route configuration in Kohana

Is there a mechanism to pass extra parameters to Controller actions in Kohana? Eg: $config['article/([0-9]+)'] = array('path' => 'news/show/$1', 'params' => array( 'param1' => 'some_stuff', )); The Kohana routing documentat...

Kohana beginner question: controllers, hooks and vars - Oh my!

I'm new to the MVC concept, and somewhat new to PHP. Question 1 Before every controller is loaded, I’d like to run a function which checks to see if a database-table exists. Is the proper way to do that with hooks? Question 2 Before every controller is loaded, I’d like to set a few variables which are determined by a call to the db. ...

Kohana 3 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 can't figure out how to read that column using ORM. Any ideas? Thanks in advance. ...

Kohana constructor purpose

As far as Kohana is concerned, can you give me a short sentence or two as to WHEN and WHY I need to use a constructor within my controller? After a LOT of reading, I can't seem to wrap my tiny little brain around the constructor concept. Looking for "layman's terms" here. =) Edit: Question pertains to Kohana v2.3.4 ...

Kohana 3 Random Query

Hello, Im new to kohana 3 here, and my understanding of it is very limited. The problem is instead of displaying the first row, what code should I use when I'll try to get a random row from a certain table? BTW: I'm using the ORM module. Thanks ...

Kohana controller URI basics

Re: Kohana v2.3.4. Do I have to create a new controller for every URL which uses segment 2? In other words, if I want my URLs to be: www.example.com/foo www.example.com/bar ... do I need to create a unique controller for foo and a unique controller for bar? I'd like to create just one controller, if possible. EDIT: I'd like to avo...

How to Kohana global variables for all controllers?

EDIT: Kohana 2.3.4 Is the proper way to make a few variables available to all my controllers to add a MY_Controller.php file in my /application/libraries/ folder (shown in the docs here)? Are there any better ways to do it, or is this the only recommended method? Being new to OOP, can you link me to any examples? EDIT 2: I've heard ...

How to start to dev a Web Directory System

Hi Guys. I am planing to build a simple web dictionary system with Kohana 3. categories . website title; . website URL; . website logo; . website description. . etc. How to write a professional design specification for my project and is there any good tutorial to start? Appreciated for reading and the replies. ...

Routing depending on the subdomain

Please help me. I am quite new to kohana. How best to do so the controller was chosen based on the subdomain. For example: www.site.com -> Controller: siteroot. Method: run admin.site.com -> Controller: adminsite. Method: run moderator.site.com -> Controller: moderatorsite. Method: run director.site.com -> Controller: directorsite. Meth...

Object properties for an indeterminate number of levels

This question is similar to this one but (literally) takes it to another level, or levels. Background: I am using the Kohana PHP framework and, specifically, the ORM library. Basically, when you loop through DB results with it, you can access the field values as properties of an object. Any joined tables can be accessed in a hierarchic...

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? ...

Best way to utilise an include file which just includes an array in PHP

Kohana's config files look like this.. here is an example of a database config file (simplified) return array( 'dbhost' => 'localhost', 'user' => 'Tom_Jones' ); I've also got a CMS which wants the connection details. Whilst the CMS uses a different user (with more rights), I'd like to know the best way to include this file a...