Welcome Guest, Not a member yet? Register   Sign In
  how to modify HTML Table class
Posted by: El Forum - 02-09-2008, 06:05 AM - No Replies

[eluser]Unknown[/eluser]
Hi,

I am just starting out with CI 1.6.

I am trying to customize the output of the HTML Table class.

I would like to specify the widths of the columns.

I have the following code:
$this->load->library('table');
$tmpl = array ('table_open'=> '<table border="0" cellpadding="4" cellspacing="0" width="640" class="sortable">');
$this->table->set_template($tmpl);
$this->table->set_heading(array('awardee', 'Year', 'Amount', '<img src="images/common/av_symb.gif">'));
$data['content'] = $this->table->generate($rows);

Basically everything works and displays a simple table.

I need to be able to specify the widths of inidividual columns, how do I do this.

I tried making each element of the set_heading an array eg:
$this->table->set_heading(array(array('awardee','width=300')), 'Year', 'Amount', '<img src="images/common/av_symb.gif">'));

This did not work.

Can someone enlighten me ?

Thanks,

Will


  how to get method name from controller ?
Posted by: El Forum - 02-09-2008, 02:32 AM - Replies (2)

[eluser]Anton111[/eluser]
I'm trying a new version ;-)
But in old version i used the following code:

Code:
$this->_method = $this->uri->router->fetch_method();
        $this->_class = $this->uri->router->fetch_class();
        $this->_directory = $this->uri->router->fetch_directory();

in the new version this code doesn't work. How can i get class, method and directory name from controller in the new version?


  where are the helpers?
Posted by: El Forum - 02-08-2008, 10:59 PM - Replies (3)

[eluser]bobqphp[/eluser]
I just downloaded CI 1.6 for the first time and was working through the blog tutorial, and noticed that the "helpers" folder has nothing but an index.html file in it. the tutorial implies there should be a set of standard helpers, but I can't find them. sorry if this is a n00b question that's been answered before, but I searched quite a bit and can't figure this out...thanks for any help


  Autoloading external files - extended view library
Posted by: El Forum - 02-08-2008, 10:30 PM - Replies (2)

[eluser]Nanodeath[/eluser]
Hi all,

I've created a little MY_Loader class that does some nifty stuff that I'll share if anyone wants it. As for what it does, I'll just cut to the chase.

It affects loading views only. If you load a view "my_view", then it automatically checks to see if there's a "my_view.js" and a "my_view.css" in a location of your choice and loads those if found. Additionally, there's a "dependencies" file in which you can specify what additional css and js files should be loaded for specific views or all views in your application. These files can be loaded every time or conditionally. For example, here's my dependencies file:

Code:
$dep['all']['js'][] = "../jquery.js";
$dep['all']['js'][] = "../interface.js";
$dep['all']['js'][] = array("../jquery.simplemodal.js", '!$CI->session->userdata(\'username\')');
$dep['all']['js'][] = array("login_modal.js", '!$CI->session->userdata(\'username\')');

$dep['learn_index']['js'][] = '../ui.tabs.js';
$dep['learn_index']['css'][] = 'http://dev.jquery.com/view/trunk/themes/flora/flora.all.css';

All views load jquery.js and interface.js in my case, and if the user is not logged in, the modal js files are loaded. For the learn_index view, learn_index.js and learn_index.css are loaded, along with ui.tabs.js and that flora.all.css.

I'm exploring a couple other ideas, like allowing the dev to pass variables to the load->view with a special prefix that can be used in the conditions in the dependencies file, or making a separate file that consolidates as much external javascript as is feasible into one dynamic file.

Anyone want this when I'm done with it, have comments, ideas, etc..? It's meant to just be a lightweight little helper. I like it because if I want to create custom javascript for one of my views, I don't have to modify the view, just create a file.


  can't send smtp email with google apps email
Posted by: El Forum - 02-08-2008, 09:23 PM - Replies (8)

[eluser]chrisco23[/eluser]
Hi all,

I'm having trouble getting any email to go out when trying to use one of my google apps email accounts.

I have these accounts working in Thunderbird just fine, and I use imap.gmail.com, port 993, SSL for inbound email, and smtp.gmail.com, port 587, TLS, outbound.

I only need outbound mail from my Code Igniter website though.

Can anyone help?

My /application/config/email.php settings are:

Code:
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_port'] = '587';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'mypassword';
$config['newline'] = "\r\n";


Thanks!
Chris


  Anyone use the js calendar plugin in 1.6?
Posted by: El Forum - 02-08-2008, 08:15 PM - Replies (6)

[eluser]dmorin[/eluser]
I updated my site to 1.6 and my JS calendar isn't working. So, after checking it out, it's failing to call the insert_date() function. Apparently in 1.6 (at lease in my version) that function has been commented out.

It doesn't look like the interface has changed and uncommenting the function works fine. Does anyone know anything about the change? Thanks.


  Error in parser class
Posted by: El Forum - 02-08-2008, 07:12 PM - Replies (1)

[eluser]ninjawebstudio[/eluser]
Hi! First of all, sorry about my english.

_I´ve got an error when trying to load libraries in config/autoload.php

Quote:Fatal error: Cannot redeclare class ci_parser in /home/ninjaweb/domains/jmlweb.es/public_html/demo/jml/system/libraries/Parser.php on line 27

If I load the libraries in the controller, I don´t get that error.

Here is my code:

CONTROLLER (portada.php)

Code:
&lt;?php

class Portada extends Controller {

    function __construct()
    {
        parent::Controller();
    }
    
    function index()
    {
        $this->load->library('general');
        $data = array(
            'url_base' => site_url()
        );
        $this->parser->parse('portada', $data);
    }
}
?&gt;


  How to have a trailing slash at the end of the URL??
Posted by: El Forum - 02-08-2008, 05:25 PM - Replies (5)

[eluser]jigen7[/eluser]
i want to have a trailing slash at the end of my url...

Code:
&lt;?=anchor('main/show_all/','Show All');?&gt;

but still at the end of the url for example where the link is it only shows

http://goldmine/jigen/jigsdb/index.php/main/show_all

the one i want to do is

http://goldmine/jigen/jigsdb/index.php/main/show_all/

so anyone have an idea?how to do this?thx


  Zip class fails to download a file if the file is around 400Kb or more
Posted by: El Forum - 02-08-2008, 04:54 PM - Replies (1)

[eluser]Unknown[/eluser]
/*
Could anybody give me some advice, I've encountered that CI Zip class fails to download a file if the file is around 400Kb or more, for smaller files it works perfectly, to isolate the problem I've put the code that fails on a simplistic script. To run this code, copy Zip.php and this script to your htdocs folder and run it from there.
*/


&lt;?php

require 'Zip.php';

$zip = new CI_Zip();

$path = 'C:/Temp/Jpg/BigFile.jpg'; // Points to the file we want to zip.

$zip->read_file($path , TRUE );

//
// This always work.
//
$zip->archive( 'C:/Temp/my_backup.zip' );

//
// This fails if the file is around 400Kb or more.
//
$zip->download('my_backup.zip');

?&gt;


  how about svn or phpDocumentator in CI proyects?
Posted by: El Forum - 02-08-2008, 04:27 PM - Replies (2)

[eluser]Olivares[/eluser]
Hello friends.

I found codeigniter some months ago, and i think is great and i start to wonder, if someone of you has used svn or phpDocumentator in a CI proyect.

Do you have some experiencies you want to share?.

cheers.


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

Username
  

Password
  





Latest Threads
Type error in SYSTEMPATH\...
by kenjis
6 hours ago
composer didn't update to...
by Sarog
8 hours ago
Pipe on url modified in %
by kenjis
9 hours ago
Best way to create micros...
by kenjis
9 hours ago
How to use Codeigniter wi...
by kenjis
9 hours ago
extend url_to helper
by kenjis
9 hours ago
Getting supportedLocales ...
by kcs
Yesterday, 08:56 AM
Limiting Stack Trace Erro...
by byrallier
Yesterday, 05:43 AM
External script access to...
by ezydev
04-21-2024, 11:41 PM
v4.5.1 Bug Fix Released
by kenjis
04-21-2024, 04:59 PM

Forum Statistics
» Members: 84,967
» Latest member: kaufenonline03
» Forum threads: 77,570
» Forum posts: 375,942

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB