kohana

Are newly created cookies not available until a subsequent page load?

这一生的挚爱 提交于 2019-12-10 23:54:18
问题 When I first create a cookie I don't seem to be able to grab that same cookie until a subsequent page load. It's as if the cookie doesn't exist to the browser until the page is requested a second time. I'm using the Kohana PHP framework: Cookie::set('new_cookie', 'I am a cookie'); $cookie = Cookie::get('new_cookie'); //$cookie is NULL the first time this code is run. If I hit the page again and then call Cookie:get('new_cookie'), the cookie's value is read just fine. So, I'm led to believe

Kohana 3 Auto loading Models

 ̄綄美尐妖づ 提交于 2019-12-10 17:37:26
问题 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() { parent::__construct(); } } I also put the class in three different locations hoping one would work, all there failed. They are: application/classes/model application/model application

php://input returns empty

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 14:19:17
问题 I have Backbone application. When model updates PUT request goes to my server. Client-side looks good. But on the server side (PHP) I have some trouble. When I first time test this request in PHPStorm: file_get_contents('php://input') return what I expect. But on the other times it always return empty. I restarted Apache - nothing helps. I know that Note: A stream opened with php://input can only be read once; But I thinked that mean one by request. Not once per life :) Where is my mistake?

Kohana 3.3 Not working from Subdirectory

百般思念 提交于 2019-12-10 11:01:47
问题 Answer: Kohana 3.3, they didn't take into account case-sensitivity on folders/files (they capitalized some directories/files) so this is going to drive some folks nuts when they start switching to the new Kohana (just like I did). I switched back to Kohana 3.2 until this has been fixed. Thank you very much for taking time in reading my huge post I had about this silly problem, and I hope this answer saves a poor souls life in the future =) 回答1: It is not correct that "they didn't take into

How can I use MongoDB in Kohana?

∥☆過路亽.° 提交于 2019-12-10 11:00:52
问题 Please, give me some startup guidance on how to use MongoDB in Kohana[v3.2]. I downloaded the Kohana Module from Mongo Module for kohana and have set up the MongoDB driver for PHP. Now I'm trying to create a new database and to save a record into it. 回答1: You Don't actually need the MangoDB module for Kohana that you linked to. You can just use PHP's MongoDB Native Driver. The mongo query language is pretty simple, if you know some MySQL then this page would help... http://www.php.net/manual

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

半世苍凉 提交于 2019-12-10 00:43:02
问题 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 when I try and go to a non existent page Kohana_Exception [ 0 ]: Required route parameter not passed: path If I make the <path> segment optional (i.e. wrap it in parenthesis) then it just

how to manage multiple templates and template assets

微笑、不失礼 提交于 2019-12-09 13:51:39
问题 I am totally newbie with Kohana and have been reading Docs, tutorials and forum posts to know how it works. I am trying to implement this framework on one of my application and now I am stuck at managing multiple templates and it's assets. Basically my application will have a templates folders like template1, template2 .... and all the images, css, js related with particular template needs to contain within the template folder. So is it possible to have such implementations? If so how can I

How to upgrade from Kohana 3.2 to 3.3 (implementing PSR-0)?

纵然是瞬间 提交于 2019-12-09 01:38:18
问题 What steps do I need tot take to upgrade from Kohana 3.2 to 3.3 with respect to the implementation of PSR-0 and what commands have to be executed from the command line? 回答1: Unix command line: These are the steps I took to implement PSR-0 in my Kohana application. I removed the following system/ dir: rm -rf system In your current bootstrap.php the only change is to make the classes start with an upper, so best is to keep your old bootstrap and just change the following lines on top of the

How to integrate Wordpress into Kohana 3

做~自己de王妃 提交于 2019-12-08 23:13:17
问题 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) cURL the Wordpress pages in. This of course means I will need to create layers between comment posting, etc, which sounds like too much work. Is there any way I

kohana 3 image save and thumbnail [closed]

柔情痞子 提交于 2019-12-08 13:43:17
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Hi I want to save an uploaded image as 2 versions (normal and thumbnail) Here is the code I'm using for normal: $picture = Upload::save($_FILES['picture']); // Resize, sharpen, and save the image Image::factory(