kohana

Kohana: Connecting to database and executing a query

I was going to post this on their forum, but they seem to be down at the moment. $mydb = Database::instance('mydb'); $query = DB::select()->from('codes')->where('name', '=', 'PHP'); 1) This doesn't appear to me using my custom database instance that I have defined in database.php. It always uses the default one. How can I tell? I...

Kohana: Connecting to DB in different ways

I am new to Kohana, and I would like to know what the difference is between: $query = DB::select()->from('codes')->where('name', '=', 'PHP')->execute($mydb); $query = DB::query(Database::SELECT, 'SELECT * FROM codes WHERE name = :name'); $query->param(':name', 'PHP'); ...

Kohana3 validation on fields with []

Hi! I have a form that contains checkboxes. <input type="checkbox" name="question[5][13]" value="1" /> Now, I want to use the Kohana validation class, but it seems like it does not validate fields that are array... had anyone ever worked something around? I have something like this, but it will not work: $rules->rule('question[5][13...

how to use php remove image files from server uploaded/inserted by fckeditor?

how to use php or Ko3 remove image files from server uploaded/inserted by HTML EDITER,such as fckeditor?is there any PHP class work for this? ...

how to use Ko3 get all image tags from a section of HTML?

how to use Ko3 or PHP get all image tags from a section of HTML? ...

Route Question About Kohana

I'am using kohana 2.3 and i have a trouble with config/routes.php. I am redirecting www.abc.com/var1/var2 to /profile/show/var1/var2 with this line: $config['(.*)/(.*)/'] = '/profile/show/$1/$2/)'; It's okey but also i want to redirect www.abc.com/var1/var2/feedbacks to /profile/feedbacks/var1/var2 but i can't done that. I am using t...

Kohana 3 ORM: constructor "after load"

Is there any way in Kohana 3's ORM to run a chunk of code in a model, but only after that model has been loaded from the database? A simple example is a required has_one relationship. ORM::factory('user')->where('name', '=', 'Bob')->find(); Now what if all users have to have some other property, so if Bob doesn't exist, it will hav...

Hit Counter counting multiple times in one request (PHP)

Hello. I am trying to create a simple Hit Counter using Kohana3 and PHP. But when I load a page with it, it counts as 1-3 times (normally, the first hit 3, then 2, then 1). The code I'm using: $game = ORM::factory('game') ->find_by_slug($slug); if(!$game->loaded()) { $this->request->redirect('/',404); } $game->times_played++...

Question mark in url (Apache)

Hello, I have a problem with a question mark in url. For example I have url "test.com/controller/action/part_1%3Fpart_2" (where %3F is url encoded question mark). With this rewrite rule "RewriteRule .* index.php/$0 [PT]" it should be passed to framework I use (Kohana) as is. At least I thought so. The problem is that everything after th...

Why would anyone use Kohana over Codeigniter

Possible Duplicate: Kohana or CodeIgniter? I have been using PHP for about a year now without a framework and I am ready to dive into one. I have been reading different sites about good frameworks and there seems to be a consensus that these two frameworks are the best ones. After doing some more reading and even on this site...

Forum/Board written atop one of the big PHP Frameworks

I was looking for a fresh forum software (threaded) or bulletin board (flat/partitioned). And I'm wondering if there's an implementation based on one of the big PHP frameworks (CodeIgniter, Kohana, Yii, CakePHP, ZF, Seagull, Fusebox, Symfony, eZ, Prado, or whatever...). Reason: A framework based implementation would be inherently more s...

Can you use underscores in table names under the Kohana PHP framework (and how)?

The underscore is a special character in Kohana and gets translated into a directory separator but since I have a bunch of existing code that uses underscores in table names, I want to know if it's possible to configure Kohana to understand that in some way. ...

url rewrite on sun web server 7

Hi, I am developing a php application with Kohana framework which enables url rewriting by default. I need to translate these rules defined in the htaccess file but I can't figure it out. # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase /kohana/ # Protect hidden files from being viewed <Files .*> Order...

need to rewrite for a mobile controller in Kohana

I am trying to rewrite in htaccess mobile.domain.com/mobile/function into mobile.domain.com/function I thought the below would work but it thinks that the function is a controller. # Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Protect hidden files from being viewed <Files .*> Order Deny,Allow De...

kohana 2 hooks mobile redirect

I placed a mobile hook in the hook directory to look for mobile devices and redirect to the appropriate controller. My question is if I want to put a link on the mobile pages to have the option to view the full site. How would by pass the hook. What is the correct way for this to be accomplished.. ...

Sorting by (order_by) foreign table value with Kohana ORM.

Is there any way to sort in orm by using a value from a forgin table? Can you do something like orm::factory("table")->order_by("table.foregin_table.column" , "ASC") or do you have to use some regular mysql and join the tables together old school? ...

Kohana URL rewriting

Hello. I've installed Kohana and there is a problem appear, when I started to edit Kohana::init and .htaccess to make it work with no '/index.php/' Here is what I'm doing. My OS is Ubuntu linux 10.04 I've changed Kohana::init 'base_url' param to '/kohana/' and on .htaccess RewriteBase is the same Also added 'index_file => '' on Kohan...

Kohana 2 jQtouch Jquery

Trying to load some data from mysql into the next screen using jQtouch. What is the correct way of doing this. Right now I just have a jquery click event on the tag for the next page which really is just a div on the same page. The jquery looks like this. $.post("/mobile/getCities", {}, function(data){ loadURL($(this).attr('href'), "#...

kohana 3 - doesn't display anything for hello world controller

I upload the kohanav3 to server and use its default contoller, Controller_Welcome in application/classes/controller/welcome.php, however it display empty result in all browser. After checking I find out they put the "ob_start" in /system/classes/kohana/core.php after commenting out, it works. Anyone having the some problem with me? ...

Kohana: Jelly-Auth and Jelly-Formo won't play well together... cause errors...

Trying to use the modules: Jelly-Auth and Jelly-Formo is causing 2 errors. Depending on how I arrange my boostrap file I can get rid of one error or the other but not both... Error 1: Auth works fine, formo doesn't: http://wellcommentedcode.com/stack_questions/formo.jpg Kohana::modules(array( 'database' => MODPATH.'database', //...