I am modifying a core function of the Kohana library, the text::auto_p() function.
The function describes itself as "nl2br() on steroids". Essentially, it provides <br /> single line breaks, but double line breaks are surrounded with the <p> tags.
The limitation I have found with it is that it will but <br />s in a <pre> element. This ...
The problem:
PHP Code (no framework)
if ($this->uid)
{
$query = sprintf('UPDATE %sUSER SET USERNAME = "%s", ' .
'PASSWORD = "%s", EMAIL_ADDR = "%s", IS_ACTIVE = %d ' .
'WHERE USER_ID = %d',
DB_TBL_PREFIX,
mysql_real_escape_string($this->username, $GLOBA...
Like the question says
...
I have a user class with static methods getById and getByUsername
I have the class in the application/libraries folder
How do I call the classes from a controller?
Theory 1:
$this->user = new User();
$this->user::getById;
Theory 2:
$user = new User();
$user::getById;
or is there a clean way of doing it much like how Kohana helpe...
I am using a feed creator (specifically, Kohana's feed::create()), except some of my text might be like this in the description element
See code below
<?php echo 'example'; ?>
The feed creator is using the SimpleXML Library. Whenever the data is returned (using $xml->asXml()) the html angle brackets inside the description elem...
example:
verify.php?uid=5&token=TOKEN
the same as:
verify/5/TOKEN
?
...
A site I built with Kohana was slammed with an enormous amount of traffic yesterday, causing me to take a step back and evaluate some of the design. I'm curious what are some standard techniques for optimizing Kohana-based applications?
I'm interested in benchmarking as well. Do I need to setup Benchmark::start() and Benchmark::stop() f...
After uploading my Kohana project to my Godaddy server, I noticed my standard .htaccess file wasn't working sufficiently to provide the clean URLs. After some guidance, I ended up with the following rule:
RewriteRule .* index.php?kohana_uri=$0 [PT,L]
This got my nice-URLs working again, but today I find out that it may be breaking my ...
I'm implementing the auth module in Kohana, and I can't seem to figure out the source of this error message--it happens when I submit a registration form that creates a user in the database (which it successfully does).
An error was detected which prevented the loading of this page. If this problem persists, please contact the websi...
I'm working on setting up caching for my site, but am having difficulty testing whether the caching is working properly or not. I've got the following in my controller:
public function read($id, $slug = null)
{
$this->cache = Cache::instance();
$story = $this->cache->get("story".$id);
if (!$story) {
$story_model = new Story_M...
here's my getter:
public function __get($field)
{
if ($field == 'userId'):
return $this->uid;
else:
return $this->fields[$field];
endif;
}
here's my constructor
public function __construct()
{
$this->uid = null;
$this->fields = array(
'username' => '',
'password' => '',
...
here's the controller function register()
public function register()
{
$userdata = array();
$formdata = array(
'uname' => '',
'password' => '',
'email' => '',
'fname' => '',
'lname' => ''
);
// copy the form as errors
$errors = $formdata;
// process data if form is submitted
...
I'm having a bit of confusion in attempting to retroactively create a new base controller for my project. If I'm not mistaken, all I need to do is create a file in application/libraries called MY_baseController.php containing the following:
class baseController extends Template_Controller
{
public function __construct()
{
parent...
Generally, my development has only covered small to medium size companies and e commerce sites.
My next project will encompass say 30 sites - however, they'll have about 95% in common with each other. I want them to have 1 'brain' that means I can roll out changes, updates to the framework etc only once.
I wonder if the Stack Overflow ...
What is the best way to determine which Controller class a Kohana application is presently using?
Examples:
http://sitesite.com/ - _defaultControllerName_
http://somesite.com/frontpage/articles - "frontpage"
http://somesite.com/contact/ - "contact"
...
i want to delete the cache in ie8 with
the following code
$this->cache= Cache::instance();
$this->cache->delete('tuinArray');
$this->cache->delete('intBreedte');
$this->cache->delete('intLengte');
i use the kohana framework it works fine in chrome and firefox, but i just seems that ie8 keeps
the cache stored, could anyone tell ...
table user:
|id|name|employee_priority_id|user_priority_id|
table priority:
|id|name|
As you can see, there are two foreign fields to the same table. But Kohana ORM default looks for a field called priority_id, which doesn't exist.
Is there a way to let Kohana ORM know that those two fields are an foreign key to that table.
...
that's about everything I need to ask:
after u call the process() method, I want to get Authorize.net response codes and text. Or is that not included in the library. All I can see are set_field() and process() methods
...
Having never worked with ORM before I thought I would give it a try today, I've come across my first problem that I don't know how to solve (due to my lack of understanding how ORM really works.)
Say I have three tables: Languages, Codes, and a pivot table Codes_Languages. These all have properly defined relationships in the models.
No...
hey, i want to format a date in mysql using
DATE_FORMAT(tblnews.datead, '%M %e, %Y, %l:%i%p')
i cant seem to get the quotes right , so i keep getting errors. how would you put this in a query?
...