kohana-3

How to access a .php file with Kohana (ignore routing)

Hi, let's say we have simple file <?php echo "hello world" I'd like to place the file in /modules/myModul/(somewhere). Where do I have to save the file and how do i call it via the browser url? ...

HTTP - 400 bad request while downloading file

Hi All, After further investigation on basis of previous question url encode/decode is working properly. Issue is something with Apache server (might be) which serves file download request Specially if my file name ends with % sign, it fails. For e.g. Original File name: 204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1,2%.pd...

How can I automatically escape data in views with Kohana 2 or KO3

What's the best way to escape data from Models or Controllers to easily and safely display them in views. It seems kind of overkill to use html::specialchars($varname) for every data variable. It can also cause problems if a programmer forgets to "escape" data. I've also encountered problems escaping ORM objects within loops. ...

htaccess to escape percent (%) from URL

Hi All, Having percent sign inside URL, returns bad request (error 400) to the browser. I have file name that have percent (%) sign, resides at server. Original File name: 204153_20090605_Aluminiumacetotartraat_DCB_oordruppels_1,2%.pdf Url in browser after clicking on download link: http://www.example.com/204153_20090605_Aluminiumace...

Routing problem with Kohana 3.0

Hi, in my current project ive a controller tree like this: Controller - ------Admin - ------------user.php ------otherClass.php Where controller and admin are folder and user and otherClass are the classes. If i want to call any otherClass method the url would be this one: example.com/otherClass But when i try to call the use...

multi insert in kohana orm3

In my application i have a loop that executes about 1000 times, inside it i'm creating object and saving it. This is the part of application where i populate my database with data. In common this looks like this: foreach(...){ ... try{ $object = new Model_Whatever; $object->whatever=$whatever; $object->sa...

Kohana 3 under PHP 5.1.6

Hello, I've been experimenting with Kohana 3 for the past few weeks, and up to now I was quite impressed. I just upload my project to the live server, and I realized I needed one of the lastest version of PHP (5.3) and that I'm stuck with 5.1.6, with this said server. Now, this may not be the cause of the problem, but every PHP variabl...

PHP Session in Kohana 3

Hey! So I'm basically unable to use any kind of session in my Kohana 3 project. A few example of the issue : $session = Session::instance(); $session->set('customer_id', $customer->id); $this->request->redirect('controller/action'); //At the start of the redirected action $session = Session::instance(); $customer_id = $session->get('c...

Share a Kohana install between sites.

Hey all, kind of new at Kohana and I have a quick question. I have a site where there will be three subsections, organized by subdomain (i.e. admin.site.com, community.site.com, www.site.com) but each of the subsections will be pulling from the same database so should be sharing the same models. Is there a way to organize it so that I c...

kohana 3 routing problem with controller action parameter

I have this routing defined in my module's init.php; Route::set('store', 'store/<store_id>(/<controller>(/<action>(/<id>)))', array( 'store_id' => '\d+' )) ->defaults(array( 'controller' => 'main', 'action' => 'index', )); and the default route in bootstrap.php is still intact. Route::set('default', '(<cont...

How to use plain SQL in Kohana 3.x

I dont want to rely on all those ORM/Querybuilder etc. tools in Kohana 3.x. I just want do use plain old SQL to Insert a new row in my table of my MySQL Database. How can I do that? ...

How do you select data from multiple tables with kohana ORM V3

Hi I can't seem to select data from multiple tables with kohana orm. When I do: $obj = orm::factory('a') ->join('b') ->on('a.b_id','=','b.id') ->select ('b.','a.') ->find_all(); The only variables available in $obj are from table a. Can someone help? ...

Kohana 3 ORM as_array return array of ORM

Hi, I'm executing a simple query and want to get an array back. Based on the ORM tutorial that comes with the Kohana 3 guide, I thought I could do the following: ORM::factory('user')->find_all()->as_array(); But that seems to give me an array of model objects (ie array( User_Model1, User_Model2 ... Looking at the source I see I can e...