kohana-3

Kohana 3 get current controller/action/arguments

In Kohana 2 you could easily get that information like this: echo router::$controller; echo router::$method; echo router::$arguments[0-x]; Any idea how that works in Kohana 3? Thanks in advance! ...

kohana v3: using different templates for different subdomains

hi, I have a kohana v3 app. 2 subdomains pointing to this app. what I have to setup that kohana uses a different template if the app called with subdomain2.example.com? at the moment all calls (from subdomain1 and subdomain2) use the standard template: 'templates/default' thank you! daniel ...

Kohana 3 - get orm validation errors

if ($user->values($_POST)->check()) { $user->save(); } else { // How can i get the errors? } Any idea how that works? Thanks in advance! ...

Best way to get session id in Kohana 3?

What is the best way to get the current visitors session id in Kohana v3? session_id() doesn't seem to work and only returns null for me.. At the moment Im using cookie::get('session'), but that doesn't work on the first time you access the site, which I need to do. I know you could do $this->session->id() in Kohana v2, but that doesn'...

Kohana 3 - Blog like route "/post/YYYY/MM/DD/search-engine-optimized-url"

Hi Guys, I'm trying to create the above mentioned route... year, month, day and title should be passed to the method. Any idea how that works? Thanks in advance! ...

Kohana 3, problem with m2m data adding

Hello I posted this on official forum but with no result. I am getting :Undefined index: enrollment error when trying to save data. My pivot model: class Model_Enrollment extends ORM { protected $_belongs_to = array('page' => array(), 'menugroup' => array()); } Model_Page protected $_has_many = array('te...

Kohana3 ORM save problem

Hi, Can anyone help me with Kohana ORM. I can take out name and value. I can give them new values and I try to save them back to base, but in phpmyadmin i can see still old values for these option attributes. What is wrong with this code (it works and echos right value but i can't see it in db): $option = ORM::factory('draft') ->where(...

Kohana3 - ErrorException [ Notice ]: Undefined index: id - Error calling Auth::instance()

Hello everybody, I've now a Problem with the newest Version of KohanaPHP (kohanaphp.com). After I've registered me and logged in into my test page, some minutes later, there is now the error: ErrorException [ Notice ]: Undefined index: id MODPATH/orm/classes/kohana/orm.php [ 1316 ] 1311 * 1312 * @return mixed primary key 1313 ...

Kohana3 - Auth Module deleting User while he is logged in bug

Hello Stackoverflow Users, Today I've tested the Kohana3, which has been changed a lot. I'm working so much with the Auth Module, and need this in my new Project also. Now I found a Bug, I think it is a bug, what can I do? Problem: After I'm deleting a user from the Database, who is at this Moment logged_in() in my Website, and he i...

How to handle this "session failed to write file" error in PHP?

I am using the Kohana 3 framework, and am using the native session driver. For some reason, occasionally the sessions fail to write to their file. Warning: session_start() [function.session-start]: open(/tmp/sess_*****, O_RDWR) failed: Permission denied (13) in /home/site/public_html/system/classes/kohana/session/native.php on line 27...

Incorporate 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 consuming, non DRY and may not work) Include the blog within an iframe (ugly as all hell...

Kohana 3 - How do I make the Default Route pass arguments to the Controller's Action?

My controller action requires a parameter, but I can't get KO3's router to pass this parameter in the Default route. This sort of thing works with other routes. Here is an example to clarify... In bootstrap.php... Route::set('default', '(<controller>(/<action>(/<the_required_param>)))') ->defaults(array( 'controller' => 'DefaultCont...

KO3: How to deal with stylesheets and scriptfiles

I'm using Kohana 3 and it's template controller. My main site template controller currently looks something like this: <?php defined('SYSPATH') or die('No direct script access.'); abstract class Controller_SiteTemplate extends Controller_Template { public function before() { parent::before(); // Initialize defa...

kohana project structure

Hello Guys. I'm investigating using Kohana for my next project. The site will consist of user registration (and hence user profiles) where users will have certain privileges. The site will also have an admin section where administrators can go to say block a user or delete a post or look at usage statistics for example. A good comparison...

Kohana 3 - Get URLs

Hi Guys, could you help me with following questions. How do i get the: absolute/relative current url http://www.example.com/subdir/controller/action /subdir/controller/action absolute/relative application url http://www.example.com/subdir/ /subdir/ I could of course use native php to get it but i think i should rather use ko3 f...

Need assistance with Kohana 3 and catch all route turning into a 404 error

Based on this documentation, I've implemented a catch all route which routes to an error page. Here is the last route in my bootstrap.php Route::set('default', '<path>', array('path' => '.+')) ->defaults(array( 'controller' => 'errors', 'action' => '404', )); However I keep getting this exception thrown wh...

Kohana PHP - Multiple apps with shared model

I'm using Kohana 3 to create a website that has two applications, an admin application and the actual site frontend. I have separated my folders to have the two applications separated, so the hierarchy looks as follows: /applications /admin /classes /controller /... /site /classes /control...

Kohana 3 simple relations..

I'm trying to write a very simple cms (for learning purposes) in kohana 3 web framework. I have my db schemas and i want to map it to ORM but i have problems with relations. Schemas:articles and categories One article has one category. One category might has many articles of course. I think it is has_one relationship in article table....

Kohana 3 Auto loading Models

I'm attempting to use a Model but I get a fatal error so I assume it doesn't autoload properly. ErrorException [ Fatal Error ]: Class 'Properties_Model' not found The offending controller line: $properties = new Properties_Model; The model: class Properties_Model extends Model { public function __construct() { ...

Themes outside application.

Hi all I read http://forum.kohanaframework.org/comments.php?DiscussionID=5744&amp;page=1#Item_0 and I want to use similar solution, but with db. In my site controller after(): $theme = $page->get_theme_name(); //Orange Kohana::set_module_path('themes', Kohana::get_module_path('themes').'/'.$theme); $this->template = View::factory('lay...