Welcome Guest, Not a member yet? Register   Sign In
  CI backend
Posted by: El Forum - 07-31-2008, 12:13 PM - Replies (15)

[eluser]Vans[/eluser]
Hi everyone,
I'm helping a friend of mine with CI developing.
My tasks are all regarding the back end.
I never used CI and I don't know how to "visit"( url or how to reach)the back end, I should see how is it to modify.
Can anyone help me please?

Thank You !


  slash in 'anchor'
Posted by: El Forum - 07-31-2008, 12:09 PM - Replies (3)

[eluser]johnmiller[/eluser]
Hi all...

I have a doubt in putting slashes in 'anchor'

suppose below given is my code

Code:
anchor ('example.com/class/function/ID/', click me);

but when i view this in address bar, i won't get slash at the end (means, after ID)

in the address bar, i want it like http://example.com/class/function/ID/

but i get http://example.com/class/function/ID (without slash in the end)

how to add slash at the end???


  CodeIgniter Community Voice - Generating PDF files using CodeIgniter
Posted by: El Forum - 07-31-2008, 11:33 AM - Replies (62)

[eluser]Derek Allard[/eluser]
This week, our Community Voice author is Chris Monnat, known on the forums as mrtopher, who writes a helpful step by step guide to generating PDF files from CodeIgniter. Chris is a full time web application developer and part time entrepreneur. In addition to building web sites for the medical industry during the day, at night Chris also runs his own development company Left of Center Communications. He recently started a personal blog at http://www.chrismonnat.com where he keeps a record of his exploits and discusses, among other things, CodeIgniter.

Read the full article


  admin and main and migrating to server with limited access
Posted by: El Forum - 07-31-2008, 11:28 AM - No Replies

[eluser]chrisco23[/eluser]
I have a CI site built on my VPS that I'd now like to transfer to my client's host, where he has no shell access, no apache config access (well, .htaccess but not httpd.conf or other vhost config).

Here's the dilemma: I built mysite.com and admin-mysite.com to both point to the same document root. On Apache IRC I was recently told not to do this but never told why.

So, the reason why I did this is to make things simpler for sharing code. The domain and the subdomain share images, javascript, stylesheets, and mp3s, etc.

I also use the common mod_rewrite method known here for removing index.php from the URL.

I have this working on my VPS by putting the mod-rewrite and, in the case of admin, the basic .htaccess authentication, inside the vhost directives in httpd.conf. Each domain has a differently named "index.php" file. One is main.php and the other is admin.php. AFAIK, I can't accomplish all the mod-rewrite, the different index filenames, and the http authentication for admin, with just .htaccess.

Can someone please suggest the simplest route to take? I've been stumped on this for a long time and now the time has come to make the migration and I'm stuck.


Thanks!
Chris


  Use a model query in a view
Posted by: El Forum - 07-31-2008, 11:18 AM - Replies (4)

[eluser]Xtrex[/eluser]
Hi, Iam using a model to preform a query:

Code:
function noticias_url($uri,$tipo) {
        $query = $this->db->query('SELECT * FROM noticias WHERE uri = "'. $uri .'" AND tipo = "'. $tipo .'"' );
        return $query->result();    
    }


How can I use the information passed by this controller in the "noticias" view? And how can I use $query->num_rows()?


Code:
$this->load->model('noticiar', '', TRUE);
        $data['noticias'] = $this->noticiar->noticias_url($uri,1);
        $this->load->view('noticias', $data);


  Ordering DB results by date
Posted by: El Forum - 07-31-2008, 10:37 AM - Replies (8)

[eluser]patrick-vibes[/eluser]
Hi,

I am trying to order my results by date to show latest portfolio items limited to 10 order by most recent.

The code I have to retrieve the results, that works fine is:

Code:
$data['query'] = $this->db->get('portfolio' , 10);

but am am not sure how to order this by date - whether I need to use the more convoluted PHP way like SELECT from ORDER BY date or if something like this is the better way:

Code:
$data['query'] = $this->db->get('portfolio' , 10);
$data['query'] = $this->db->orderby("date", "ASC");

I know it might be a simple question but I have had a good trawl through the userguide and forum and can not find a simple answer.

Thanks in advance.


  help redirecting
Posted by: El Forum - 07-31-2008, 10:07 AM - Replies (1)

[eluser]Xtrex[/eluser]
Hi, how can I do to redirect to other controller in a controller? this is my controller

Code:
if ($this->noticiar->noticias_url($uri,1)) {
               $this->load->view('noticias');
            } else {
               // Go to /noticias/example
            }


  Using Classes in Helper files?
Posted by: El Forum - 07-31-2008, 09:58 AM - Replies (3)

[eluser]Iverson[/eluser]
I'm using CI's database class in my controllers. I have a "is_logged_in" function that I will have to use in every controller/view so I created my own helper file because I don't want to have to copy and paste it over and over again. I check the session footprint against the footprint I put into my database. However, now I have no way of getting to the database or the session data because I can't use the class functions inside a regular function. Ideas? Or am I just missing something?


  Loader question
Posted by: El Forum - 07-31-2008, 09:52 AM - Replies (2)

[eluser]Carl_A[/eluser]
I just installed FreakAuth_light, and i was getting the following error, which i posted Here

I fixed that by moving the function to load the library

Code:
$this->load->library('FAL_validation', 'fal_validation');
into the constructor of the class.

Now I see that all classes that load libraries within other functions (not the constructor) are causing the same error.

Can libraries not be loaded outside the constructor?

If they can, is it something to do with some settings? I even tried it on my older project, i get the same error if I dont load libraries within the constructor itself..


  faster,better way to get stuff from db + add/edit theory
Posted by: El Forum - 07-31-2008, 09:29 AM - Replies (16)

[eluser]xpix[/eluser]
How would you improve the following:
(I am trying to get the status field from jobs table)

Code:
//get job status
        $this->db->select('status');
        $this->db->where('id', $id);
        $query = $this->db->get('jobs');
        $queryresult = $query->result();
        if($queryresult[0]->status){
            
        }else{
            
        }


Thx


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Array to HTML "Table"
by paulkd
7 hours ago
TypeError when trying to ...
by b126
8 hours ago
Webhooks and WebSockets
by InsiteFX
Yesterday, 10:39 AM
Retaining search variable...
by pchriley
Yesterday, 05:46 AM
Reading a session variabl...
by xanabobana
Yesterday, 05:05 AM
Update to v4.5.1, same us...
by kenjis
04-17-2024, 07:47 PM
Codeigniter 4 extend core...
by Semsion
04-17-2024, 05:08 AM
v4.5.1 Bug Fix Released
by lokman
04-16-2024, 02:12 PM
problem with textarea
by Nitin Arora
04-16-2024, 05:07 AM
Showing pdf on browser
by aarefi
04-16-2024, 04:38 AM

Forum Statistics
» Members: 84,570
» Latest member: Codesuite
» Forum threads: 77,558
» Forum posts: 375,896

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB