kohana

"current" class on menu

Heya, I'm creating a menu and was wondering if how i would add a class of "current" on a menu for the current page e.g. http://emberapp.com/. Any help appreciated! ...

Database error-kohana framework

I am getting a a page not found error every time i connect to the database. On the page of the database i have to login twice, but how can i solve this problem ? Because i think the problem is that i have to login twice. ...

Suggested design for submitting a table of data in PHP

Hi I'm looking for suggestions on how best to handle the submission of a database table. So far, I've generated the repeating rows data like so: <table border=1> <tr> <th>Phone Number</th> <th>Prefix CallerID with</th> <th>Seconds to ring before<br/>reaching voicemail</th> <th>Voice mailbox<br/>extension number</th> <th>Not...

How to turn off kohana's string sanitisation temporarily

I'm building a dynamic form in Kohana and notice that it is doing the following: echo "'"; results in &#039; in the output instead of a literal ' character. I suspect its xss_clean getting in the way which is normally a good thing, but if I want to avoid it I have to code differently when I need a literal ' output to the page. ...

Any other PHP frameworks use a cascading file system?

I really like the Kohana cascading file system. Do any other PHP frameworks feature this? I want to learn another framework besides Kohana, but I'd love to be able to use the awesomeness of the file system. ...

Kohana Error: `The log directory is not writable`

I have a project I checked out in Kohana and I'm trying to get it running on a local server and I'm getting the issue here: http://djaffry.selfip.com:8081/ The permissions for the logs folder is the same as for everything else, drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 cache drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:21 config drwx...

How can I change the default database used in Kohana 3?

I've set up a new database config in application/config/database.php called staff. I've then made a new base model, and added a protected $db variable and set it in the constructor to $this->db = Database::instance('staff'). When I try and replace Db::query(Database::SELECT, $query) with $this->db->query(Database::SELECT, $query), it f...

Do CodeIgniter modules work for Kohana?

CodeIgniter's got a slew of modules (http://codeigniter.com/wiki/Special:Titles/), but all I can find for Kohana (CI's fork) is http://dev.kohanaframework.org/projects/. Is the assumption that CI modules work in Kohana (or at least can be massaged to without too much effort), or is it just that Kohana's got fewer modules? ...

How can i mix OR and AND in ORM queries

I am developing a site using kohana 2.3 and am having trouble with a specific ORM query. Essentially what I am doing is the following query SELECT * FROM 'records' WHERE ('ServRepSupervisor' = name AND 'Followup_read' = 0) OR ('ServRepSupervisor' = name AND `read` = 0) when I try the ORM query like this... $unread = ORM::factor...

how can i get ORM to work with 2 separate databases without foriegn keys defined in the tables?

I'm not even sure if this is possible. I am using Kohana framework(ver 2.3). I have 2 separate databases. One called 'employees' and another called 'tracker'. The databases are used in 2 different websites. I want to eliminate a table in the tracker database called 'csr', which contains identical employee data, and link the tracker to th...

Select List with a NULL that gets committed in SQL

I have a select list like the following inside of a form. <select name="0[voicemail]" > <option value="" selected="selected"></option> <option value="800">800</option> <option value="801">801</option> <option value="802">802</option> <option value="803">803</option> <option value="805">805</option> <option value="807">807</option> <opt...

Kohana - Authenticating Users?

I would like to get started on a simple project using the Kohana 3 framework (looks very promising), but the docs are a bit lacking in my opinion and would like some direction to get my feet wet and get me started. So I have a simple use-case question one that most every application needs. How would you present a login form with a usern...

SQL join with Kohana ORM

I'm using Kohana 3.0.6 with ORM. I have a model named "truck" and in his table there's a column with the id of his maker ("maker"). Then I have the "maker" model with the id and the name in his table. I'm trying to do a simple LEFT-JOIN when I display the listing of the trucks so I can get directly the names of their maker. Here is my...

How to use database functions in Kohana 3 ORM select query

I'm using Postgres with Kohana 3's ORM module and would like to run a SELECT using a postgres function to convert values already in the database to lower case before doing the comparison. In SQL I would write: select * from accounts where lower(email) = '[email protected]'; In Kohana I would like to write something like this: $user = O...

How can I create a simple internationalization (i18n) example in Kohana v3.0.6.2?

I've been trying to make i18n work: Just to display a string with 2 different languages. I followed this tutorial, but I think the author is not using Kohana 3. It basically consist on creating a langauge file (pl.php) file in the i18n folder, and add the following: <?php $translations['Good Morning'] = 'Magandang Umaga'; Then cha...

How can I change the preferred language when clicking in an anchor link (Kohana's i18n)?

I have a es.php and a tl.php in the i18n folder: es.php: <?php defined('SYSPATH') or die('No direct script access.'); return array( 'Good Morning' => 'Buenos Dias', ); tl.php (is the abbreviation of a human language. No idea which one): <?php defined('SYSPATH') or die('No direct script access.'); return array( 'Good M...

Kohana 3: Using a custom controller.

Hi All, In KO2, I had a file called libraries/CUSTOM_Controller.php, in which I kept common methods that I wanted to be available to all controllers. Is there a similar way to do this in KO3? I don't see anything in the docs (such as they are) about overriding the controller. Thanks! ...

Storing HTML into a javascript variable

I'm having some trouble with some javascript. I'm using jQuery to dynamiclly add rows to a table. Additionally the javascript is being generated from some PHP and Kohana code. Here is the script. <script type="text/javascript"> function delExtensionNumber(element){ $(element).prev().attr('value', 'X'); $(eleme...

References to same table

Hi, Im writing a simple editor for a game, to manage the relationships between creatures. The creatures table is setup with a id, name etc. and a boolean is_prey column; what I need is to figure out how a) an ORM relation can be defined between id's from the same table b) how to limit the 'available' other-nodes to only include the ones...

Sharing controllers, models and views between separate projects in CodeIgniter

Kohana, due to cascading file system and modules, allows to share code in common projects, that contains controllers, views and models directories. How can I do it in codeigniter? I want to create sites, that will share some code (admin area views, some models). That is easy in Kohana, we just have to add another directory for Kohana::fi...