Welcome Guest, Not a member yet? Register   Sign In
  using codeigniter components
Posted by: El Forum - 09-18-2008, 09:27 AM - Replies (4)

[eluser]nation-x[/eluser]
Is it possible to use Code Igniter components in a third party app? I am asking because I need a solid Session manager and the code igniter session manager seems like it works great... but I don't want to rewrite my whole app in code igniter.


  $this->load->view and exceptions
Posted by: El Forum - 09-18-2008, 09:04 AM - Replies (1)

[eluser]Unknown[/eluser]
Hi,

I had hoped:
$this->load->view('missing_view')
would throw an exception, or return an error code. It seems to do neither. Instead, it internally generates an error page, and does an exit (see: Loader->_ci_load()). I'm not used to API calls that behave this way. Was there a good reason for this design decision? I know some people dislike exceptions, but throwing exceptions when resources are missing is pretty common (for example, most file system implementations use exceptions for "file not found"). Also, the idea that an API call terminates my program is... worrysome...

Why did I hope this? I have pages that can be customized on a per customer basis, yet I have a default look & feel. So, I was going to do something like
try {
$this->load->view('pagename_'.$customer_name);
} catch(Exception $e) {
$this->load->view('pagename_default');
}

or
if(!$this->load->view('pagename_'.$customer_name)){
$this->load->view('pagename_default');
}


Is there a more clever solution to my use case? Using data from the controller to parameterize the view feels very wrong to me, as it's only the view that is changing. Plus, the data to track if a customized view exists or not will just add another piece of needless data that can be overlooked.

I could change Loader->_ci_load() to throw an exception (and I did for grins, and it worked), but I'm loathe to change system libraries.

Thanks,

will


  Mail on error
Posted by: El Forum - 09-18-2008, 08:46 AM - Replies (3)

[eluser]FinalFrag[/eluser]
Hi all,

I want to extend the error reporting class to send me an e-mail when an error happens. I think I would have to create a class MY_Log to extend the CI_Log class. I have the following code in MY_Log:

Code:
<?
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Log extends CI_Log {
    function MY_Log() {
        parent::CI_Log();
    }
    
    function write_log() {
        parent::write_log();
        mail('[email protected]', 'err', 'err');
    }
}
?>

This doesn't seem to work. Could anyone explain to me why?

I also altered my autoload.php to automaticly load the Log class (but I'm not sure if this is really necessary)...

I'm really confused to which class I have to extend and which functions to overwrite as it seems like there is a global function 'error_log' and a function 'write_log' in the Log class. Which one should I extend?

Hope anyone can help me out on this one...

Thnx in advance, FinalFrag


  controller folder structure question
Posted by: El Forum - 09-18-2008, 07:18 AM - Replies (2)

[eluser]dpgtfc[/eluser]
Hello,

I'm wondering if it is possible to organize my controllers into sub directories. If I have 20 of them, and they can be grouped into some sort of functionality, is there a way to put them into separate sub-directories of the application/controller folder?

I do this with my models, my libraries and my views, but I don't know if it would work with controllers. Would CI look for them automatically, or would I have to change some settings?

Thanks in advance,

Daniel


  First website built with CodeIgniter
Posted by: El Forum - 09-18-2008, 07:12 AM - Replies (3)

[eluser]the future darlo manager[/eluser]
I updated a website I write for to work with CodeIgniter.

http://www.loidland.com/

Whilst not the most interactive thing in the world the framework made it easy to turn my old php into code for the framework and I reckon updates for the future are going to be a lot easier now.

Would appreciate any thoughts (and yes I know I need alt tags on my images) :-)


  Importing class file in CI
Posted by: El Forum - 09-18-2008, 07:08 AM - Replies (5)

[eluser]Computerzworld[/eluser]
Hello,
I am having one class that is created in traditional PHP and using adodb for database connection. I want to use this class in my controller. Is it possible to do so? If yes then how? Please tell me. Thanks in advance.


  Whats the best way
Posted by: El Forum - 09-18-2008, 06:58 AM - Replies (6)

[eluser]zeedy2k[/eluser]
Whats the best way for me to include a remote message on my clients admin panels? I was using javascript which was limited but dont know if thats the best way to do it... I want to be able to supply parameters in my admin panel like colour and things like that and pass that through to be displayed on my clients admin panel.

Thanks in advance.

Robert


  Hi, Please Help on this error
Posted by: El Forum - 09-18-2008, 06:47 AM - Replies (4)

[eluser]almarjin[/eluser]
Hi Guys,

I got this error some times.

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at C:\server2go\htdocs\UMDP\system\application\controllers\phones.php:124)

Filename: libraries/Db_session.php

Line Number: 248


Thanks.


  CI, FreakAuth libraries, API, and misc...
Posted by: El Forum - 09-18-2008, 06:28 AM - Replies (2)

[eluser]vclef[/eluser]
I'm doing a small app for fun using CI and FAL and have a few questions.

1. Does FAL have APIs to get ALL users and admins? I looked at the index() in the FAL's admin/admins controllers and it seems to do just that. So I thought it doesn't have it. Could you confirm? If that's the case, I'd extend FAL library using MyFAL_demo as a template. If someone already did that, would you mind sharing your code? I don't want to 'reinvent' the wheel Smile

2. This question is kinda basic, but why can't I do $this->freakauth_light->belongsToGroup()in the view code? I'm currently using getUserProperty('role') as an alternative.

Any pointer or suggestion is much appreciated.


  Using CodeIgniter to interface with vbulletin database?
Posted by: El Forum - 09-18-2008, 06:21 AM - Replies (1)

[eluser]TheActionCombo[/eluser]
I want to make a CodeIgniter app that requires people to login using their vbulletin login (and pull other data from the vbulletin db, such as the avatar). Is this possible?

I'm familiar with CodeIgniter -- just never dealt with VB.


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

Username
  

Password
  





Latest Threads
Bug with sessions CI 4.5....
by ALTITUDE_DEV
2 minutes ago
codeigniter 3.0.1 equiped...
by JustJohnQ
3 hours ago
Display a custom error if...
by b126
7 hours ago
Type error in SYSTEMPATH\...
by DXArc
7 hours ago
v4.5.1 Bug Fix Released
by LP_bnss
8 hours ago
Retaining search variable...
by Bosborne
10 hours ago
Getting supportedLocales ...
by InsiteFX
Today, 12:24 AM
composer didn't update to...
by Sarog
Yesterday, 03:56 PM
Pipe on url modified in %
by kenjis
Yesterday, 02:52 PM
Best way to create micros...
by kenjis
Yesterday, 02:50 PM

Forum Statistics
» Members: 85,070
» Latest member: cwin05llc
» Forum threads: 77,572
» Forum posts: 375,954

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB