I have a controller “user” in my codeigniter application. This controller has a function called logged_user_only(): public function logged_user_only() { $is_logged = $this -> is_logged(…
Tag: codeigniter
What is the best way to make a breadcrumb with Code Igniter?
I wonder what a best way to make a breadcrumb with Code Igniter. 1 : Retrieve the strings with URL example : $this->uri->segment(2) 2 : Do you know another way ? I’d really like to have your opinion Answer Using URL segments is specific to how you have your URL structured – there is not always a 1:1 match. http://forum.codeigniter.com/thread-25372.html?highlight=137949
Why is part of the HTML email appearing as text in email client?
I am trying to send HTML emails with Codeigniter’s email class. This is how I am doing it: However, when I view the email in Gmail or outlook, I see bunch of HTML appearing as text at the top of the email and the rest of the email is displayed normally. Here is the HTML I am sending, its a
Excel output with codeigniter
I’m trying to get a report from my codeigniter project in excel, but I am at a complete loss on how to do it. It already works well, just would like the output in excel rather then a page. Any tips/pointers/explanations? thanks! Answer I’ll refer you to this wiki article from the codeIgniter site, or to this tutorial
How to set date.timezone for CodeIgniter to work with php 5.3
When date.timezone in php.ini is commented out, it gives me: A PHP Error was encountered Severity: Warning Message: main(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely
Codeigniter variables from constructor are undefined
I’m using CI’s Auth Tank library to query records for certain users. The variable $user_id = tank_auth->get_user_id(); grabs the user id from the session. I want to pull records where user_id = $user_id. From what I understood, constructors can load variables each time a class is initiated. Sort of like global variables. So I figured I’ll set my $user_id in
Object of class stdClass could not be converted to string
I am having a problem with PHP at the moment, I am getting this error, Object of class stdClass could not be converted to string the error occurs when I run this portion of code in my site, …
CodeIgniter without a Database?
Sorry if this is a simple question, is it possible to load codeigniter without a db setup? I have sess_use_db set to false in the config, I tried renaming database.php to something else but it still wants to load it, I turned active records off also. I tried commenting everything out in the database.php and it said no database settings
Where do you put non-controller classes in codeigniter?
I’ve got a class Widgets. Widgets are made up of Doohickies. I’m never going to need to access Doohickies directly via url — they’re essentially a private class, only used by Widgets. Where do you put your code to define the Doohicky class? In /app/controllers/doohicky.php? in app/controllers/widget.php? somewhere else? Obviously, the former seems cleaner, but it’s not obvious to me
How to select rows where column value IS NOT NULL using CodeIgniter’s ActiveRecord?
I’m using CodeIgniter’s Active Record class to query the MySQL database. I need to select the rows in a table where a field is not set to NULL: That only returns this query: The archived field is a DATE field. Is there a better way to solve this? I know I can just write the query myself, but I want