Part of the EllisLab Network
   
3 of 5
3
CodeCrafter 0.3.0 (BETA) - CRUD Source Code generator for CodeIgniter released
Posted: 27 June 2007 08:00 PM   [ Ignore ]   [ # 31 ]  
Summer Student
Total Posts:  4
Joined  06-25-2007

Hi Crafter (again),

there seems more work to be done… there are more problems if generating the code using ActiveRecord - I guess you know, not going into details wink

best regards

Profile
 
 
Posted: 28 June 2007 04:41 PM   [ Ignore ]   [ # 32 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

I must apologise for my tardiness, I had addressed many of these annoying bugs some tome ago, but waited to release them with some additional features.

Unfortunately, life got the better of me and in the process of fighting running battles with Clients and Family, it never got round to finishing.

I have,  however, loaded a my development snapshot (Version 0.3.2) with many, many bug fixes, including the last few reported ones. You can download that version here:
http://www.datacraft.co.za/codecrafter/

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 28 June 2007 05:35 PM   [ Ignore ]   [ # 33 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  208
Joined  06-12-2006

version 0.3.2 or 0.3.1?

Profile
 
 
Posted: 02 September 2007 12:14 AM   [ Ignore ]   [ # 34 ]  
Summer Student
Total Posts:  2
Joined  09-01-2007

Just discovered CodeCrafter and am exploring v.0.3.1(beta). Loaded just fine on CI and was able to connect to a database and successfully read the tables. Very excited by the apparent results. However, after the temp files are created in the ‘crud-output’ directory and then moved the appropriate ‘production’ directories I run into some problems.

When I browse to:
http://localhost//appmain
or
http://localhost//location (there’s a table called ‘location’ etc.)
an error is generated:

An Error Was Encountered
Unable to load the requested
class: Layout

Exploring the ‘/application/libraries/Layout.php’ file does not seem to reveal anything.

I did note that the auto-generated files in ‘crud_output/controllers/’ have a funny first line which I corrected:

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

Any guidance on this issue would be very greatly appreciated.

Profile
 
 
Posted: 02 September 2007 03:29 PM   [ Ignore ]   [ # 35 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

Your output should be in the following directories:
system/application/crud_output/controllers/
system/application/crud_output/views/
system/application/crud_output/models/
system/application/crud_output/libraries/    <== LOOK HERE

Otherwise, you can just ger a copy from
system/application/views/template/layout_library.src

Just copy this your your application/libraries/ directory as Layout.php

Of course, you don’t have to use the layout library, just read the comments in your controller and use the raw views instead, as in the code snippet.

// COMMENT THE TWO LINES BELOW
      // $this->load->library('layout');
      // $this->layout->render_page('/modx_active_users/modx_active_usersgrid', $the_results);
      // NOTE: If you don't want to use the layout library, use the line below.
      
$this->load->view('/modx_active_users/modx_active_usersgrid', $the_results);
      
// UNCOMMENT THE PREVIOUS LINE
 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 02 September 2007 03:33 PM   [ Ignore ]   [ # 36 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

I’m not seeing the

<?phpphp

Is there not some setting in CI that’s forcing this?

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 02 September 2007 08:32 PM   [ Ignore ]   [ # 37 ]  
Summer Student
Total Posts:  2
Joined  09-01-2007

Many thanks Crafter.

The ‘double’ php is showing up on my systems if I use the ‘long tags’ option under Code Options.

Am testing this on two systems, both local: 1 is a XAMPP install using PHP4 on a WinTel box. The other is a local Ubuntu based Linux box running Apache and PHP4 that I use for development testing. Same results on both systems.

No luck yet in getting the Layout class to load properly. Thanks for the directory map, but that seems to be what I’m using. I’m more than willing to believe that the problem exists between the keyboard and the chair, but I can’t sort it out just yet. wink

Will post more after the next series of tests with a fresh install.

UPDATE:
No joy. Similar issues.
Tried viewing http://localhost/hgo/appmain where ‘hgo’ is the app path. Got an interesting result:

Left side display’s text:

* location <== this is one of my table names.

    *
Browse
    
* Add New
    *
Find (not yet)

(edit: all three of the above links result in the layout class not loading error.)

Right side displayes error:

A PHP Error was encountered

Severity
: Notice

Message
: Undefined variable: page_contents

Filename
: site/main.php

Line Number
: 7


Commented out the layout defaults as you suggested.This produces a page where the table field names are displayed and a single “Add” button appears in the top right corner. Clicking the “Add” button generates a new page with the same old ‘layout class’ error.

J.

Profile
 
 
Posted: 04 September 2007 03:28 PM   [ Ignore ]   [ # 38 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

To get of the $page_contents error, change line 7 of
views/sitemain.php
from

<?= $page_contents: ?>

to

<?= isset($page_contents)?$page_contents:''; ?>

I’m not sure about the layout libary, but in your controllers/location.php. there are a few places where the layout library call must be replaced by the view count. The change in post #35 must be carried out in each case.

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 03 November 2007 04:22 AM   [ Ignore ]   [ # 39 ]  
Grad Student
Avatar
Rank
Total Posts:  33
Joined  07-10-2006

Ubuntu 7.10, fresh CI install, using XAMPP for Linux 1.6.4, PHP 5.

Same <?phpphp on long tags.
Same notice of undefined variable: page_contents on site/main.php line 7.
Same problem with “Unable to load the class: layout”. 

Changing case on the layout load, trying different locations, so far no luck.  Sadly CodeCrafter and I have never been able to get along well.

 Signature 

Shane

Net Like Blog
Free Wallpapers

Profile
 
 
Posted: 04 November 2007 03:38 PM   [ Ignore ]   [ # 40 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

Some quick solutions for you:

- <? phpphp problem
  In your system/application/views/template/somefile.php
  Change <?php to <? before applying the log tags solution

- $page contents.
  Look at post #38 above

- layout class
  Look at post #35 above

I’ve not had time to address the outstanding issues recent;ly, but will be addressing them soon.

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 19 November 2007 12:21 PM   [ Ignore ]   [ # 41 ]  
Summer Student
Total Posts:  12
Joined  06-13-2007

Hi,

Thank you for CodeCrafter. It’s amazing and I’m a complete fan.

I’ve encountered the exact same problems as Judis had mentioned (and then some). The new version is what I installed just now (v.0.3.1), and it worked fine until I tried to run the code generated and the resulting errors are almost exactly like Judis’.  I thought an earlier fix made did it, but it appears it only fixed appmain and the /add and /find functions give a similar error of not being able to load the ‘layout’ class, and a 404, respectively.

Bypassing it and using $this->load->view(...) did work though.

Any ideas why it can’t load the layout class from the library?
(btw, the Layout.php file is in the “libraries” folder just fine)

Profile
 
 
Posted: 22 November 2007 02:51 PM   [ Ignore ]   [ # 42 ]  
Summer Student
Total Posts:  6
Joined  03-12-2007

this might sound profane but, does it work with m$sql??

Profile
 
 
Posted: 22 November 2007 11:11 PM   [ Ignore ]   [ # 43 ]  
Research Assistant
RankRankRank
Total Posts:  558
Joined  06-17-2006

Currently, Codecrafter itself only works with mysql.

This is untested, but the generated code should work with any database supported by CI, especially of you use the activerecord option..

 Signature 

CodeCrafter - Open Source Code Generation for CI

Profile
 
 
Posted: 26 November 2007 04:19 PM   [ Ignore ]   [ # 44 ]  
Summer Student
Total Posts:  6
Joined  03-12-2007

Yes Indeed, I just tested it, the generated code works actually with m$sql server with just very few changes, thanks!!!

Profile
 
 
Posted: 20 February 2008 02:40 AM   [ Ignore ]   [ # 45 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  136
Joined  09-04-2007

Hi Crafter!

I want to tidy the CodeIgniter Wiki and I’d like to know what’s develepment status of CodeCrafter. Is it still maintained or have you moved on to something else?

Profile
 
 
   
3 of 5
3
 
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 819, on March 11, 2010 11:15 AM
Total Registered Members: 120353 Total Logged-in Users: 35
Total Topics: 126481 Total Anonymous Users: 4
Total Replies: 665157 Total Guests: 376
Total Posts: 791638    
Members ( View Memberlist )
Newest Members:  ejsexton82jackmarioRanjanjoyMihai NorthThatchVagariPatient ShareNixnizviVadotlogik