Part of the EllisLab Network
   
 
Poll
Should I continue on this idea?
Yes 8
No 3
Don’t care 2
Total Votes: 13
You must be a logged-in member to vote
Extended CodeIgniter Application Development Standards
Posted: 15 May 2007 11:37 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  137
Joined  02-04-2007

Hello

I would like to propose to disgust Extended CodeIgniter Application Development Standards
As soon as we agree on something we can then post the new standard on the wiki or even better create a test application template

Here are a few suggestions.

We don’t all use the same authentication method so I think we should come up with a uniform way of authenticating. My suggestion is that we use following:

$this->session->set_userdata(array('uid'=>1));
$this->uid = $this->session->userdata('uid');


where uid 1 is dedicated to the admin.
Any suggestions on this?
==========
We had some great contributions lately. One of my favorites is PQuery the PHP jQuery Ajax library. Great library and very good presentation of the test suite I think we can make contributions easier on the developer and the user.

I suggest we add following definitions to the bottom of each start page index.php most of the time.

define('BASEURL', 'http://'.$_SERVER['HTTP_HOST'].'/');
define('APPURL', BASEURL.str_replace ( $_SERVER['DOCUMENT_ROOT'], '', APPPATH );
define('SITEURL', BASEURL.'index.php/');

Applications test suites could be formated like pquery did, a full application suite added like this.
/system/application/pquery/ then config, controller, etc below that
call the start page pquery.php in place of index.php
this way you can access that test application like this:
http://localhost/pquery.php/
Your prime application does not get effected at all and you don’t have to create a whole new instance of ci.

There is more but I am running out of time besides I like to see how your reaction is to my suggestions so far.

Thanks for taking the time ‘I’ll be back’  cool smile

 Signature 

TaMeR

This is my CodeIgniter web site. If you see something you like/need let me know.
PzzAzz Mobile Advertising

Be who you are and do what you do for those who mind do not matter and those that matter do not mind!

Profile
 
 
Posted: 15 May 2007 11:49 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  137
Joined  02-04-2007

I just had to add one more suggestion

We could standardize the way javascript, css files and other head data is included.

Here is my suggestion for a header.php file

<?php
    $this
->timetamer->setTZ();
    
$menu = $this->menu->mkmenu();
//    $msg = $this->msg->getMsg();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<
head>
<
title><?=$title?></title>
<
meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<
meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<
meta name="Description" content="<?=$title?>" />
<
meta name="keywords" content="<?=$title?>" />
<
meta name="rating" content="General" />
<
meta name="author" content="Dennis T. Kaplan" />
<
meta name="copyright" content="Dennis T. Kaplan" />
<
meta name="generator" content="Codeigniter" />
<
meta name="date" content="01/22/2007">
<
meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<
meta http-equiv="content-style-type" content="text/css">
<
meta http-equiv="expires" content="0">
<?php
$tplcss[]  
= 'layout';
$tplcss[]  = 'base';
$tplcss[]  = 'menu';
foreach(
$tplcss as $v){
    
echo '<link href="/public/css/'.$v.'.css" rel="stylesheet" type="text/css"  media="screen" />'."\n";
}
unset($tplcss, $v);

if(isset(
$tpljs)){
    
foreach($tpljs as $v){
        
echo  </script type="text/javascript" src="/public/js/'.$v.'.js">'</script>'."\n";
    
}
    
unset($tpljs, $v);
    
}
if(isset($head)){
    
echo $head;
    unset(
$head);
}
?>
</head>
<
body>

 Signature 

TaMeR

This is my CodeIgniter web site. If you see something you like/need let me know.
PzzAzz Mobile Advertising

Be who you are and do what you do for those who mind do not matter and those that matter do not mind!

Profile
 
 
Posted: 15 May 2007 12:09 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  512
Joined  12-05-2006
CI TaMeR - 15 May 2007 11:49 AM

I just had to add one more suggestion

We could standardize the way javascript, css files and other head data is included.

You might be interested in my layout helper functions.

I posted them yesterday in this thread.

smile

 Signature 

FreakAuth_light: pluggable & extendable authentication library that works on CI 1.5.X

CI SWIFT MAILER: 44% less memory than PHPMailer at double speed

Using Zend Framework components in Code Igniter

Profile
 
 
Posted: 15 May 2007 01:35 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  137
Joined  02-04-2007

Looks good, I like it.

Could we use a naming convention for view files?
For example i use this:

$this->tpl['tpljs'][]  = 'title_to_slug';
$this->tpl['head'] = '';
$this->tpl['title'] = 'Admins Desk';
$this->tpl['body'] = '';

I use $this-> because not all of my view code comes from the same function. $this-> adds some flexibility.

Could also be

$this->view['title'] = 'Admins Desk';


So yes I think your helper would be a great addon to be included in the TestSuite Template.
I started creating a TestSuite so if you could post a complete functional drop in with your helper a header.php and a footer.php file I will included in the TestSuite.
As soon as I got a alfa version I will post it in a svn and I will give you access to post your updates until then a zip file would be fine.

Thank you

 Signature 

TaMeR

This is my CodeIgniter web site. If you see something you like/need let me know.
PzzAzz Mobile Advertising

Be who you are and do what you do for those who mind do not matter and those that matter do not mind!

Profile
 
 
Posted: 18 June 2007 06:18 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  763
Joined  06-11-2007
CI TaMeR - 15 May 2007 11:37 AM

$this->session->set_userdata(array('uid'=>1));
$this->uid = $this->session->userdata('uid');

where uid 1 is dedicated to the admin.
Any suggestions on this?

One suggestion, DONT. User id 1 is always a bad idea in case you fall out with number 1 and delete him :p

Just use some sort of basic auth system, FAL intergration sounds fine to me, and we need some sort of extended output library that takes header/footer files with name and blocks. I began one like this which could easily be created into a portal script for and be used for uniform page creation with multiple output options.

[Source Code] Obviously needs some basic updates to make it more generic but you get the idea.

 Signature 

PhilSturgeon.co.uk - Personal blog site using my new CMS.
StyleDNA Ltd - CodeIgnitor Web Development, Hosting and Design.
_________________

Helpers: Asset Helper, BBCode Helper
Libraries: Layout Lib
_________________

Theres no place like 127.0.0.1

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 64453 Total Logged-in Users: 26
Total Topics: 80959 Total Anonymous Users: 0
Total Replies: 435681 Total Guests: 172
Total Posts: 516640    
Members ( View Memberlist )