Yii Framework Forum: Giix — Gii Extended - Yii Framework Forum

Jump to content

  • (14 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • 8
  • 9
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Giix — Gii Extended a code generator for Yii PHP framework (scaffolding/code generation) Rate Topic: ***** 4 Votes

#121 User is offline   ManInTheBox 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 17-June 11

Posted 11 September 2011 - 01:08 PM

Thanks for a fast reply!
I really need to try all features of giix, once again great extension :)
0

#122 User is offline   Saulo Vallory 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 16-September 11

Posted 16 September 2011 - 11:21 PM

Hey, thank you for the extension. I'm loving it!

I'm working on the templates for generating haml views based on giix crud templates. I've set up a repo on github with the code. As I'm new to the forum I can't post links :/ (it really sucks) but you can figure this will do: github.com/svallory/giix-haml

I've changed the rendered structure to add semantics and will provide a basic stylesheet to adjust it to the basic yii template look and feel.

cheers,
Saulo
0

#123 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 17 September 2011 - 07:58 AM

View PostSaulo Vallory, on 16 September 2011 - 11:21 PM, said:

I'm working on the templates for generating haml views based on giix crud templates. I've set up a repo on github with the code. As I'm new to the forum I can't post links :/ (it really sucks) but you can figure this will do: github.com/svallory/giix-haml


Hi Saulo, I saw your PM too.

That's sweet!
I have good news for you: giix will have its own extension repository. Your template + generator can be there.
What do you think about it?

And thanks for your contribution and kind words :)
0

#124 User is offline   Saulo Vallory 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 16-September 11

Posted 17 September 2011 - 01:26 PM

View Postmentel, on 17 September 2011 - 07:58 AM, said:

I have good news for you: giix will have its own extension repository. Your template + generator can be there.
What do you think about it?


That's awesome! Just let me know when it comes out and I'll pack and post it there.

Have you thinked about using github over google code? I noticed most of people here use google code. I'm not a git fanatic I just think it's much easier for people to colaborate. For example, if giix was on github, I would send you a pull request, you could review it and, if you wanted, pull it easily to your repository right now.

I think the 'commit access' is a great barrier to contributors.
0

#125 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 17 September 2011 - 05:34 PM

View PostSaulo Vallory, on 17 September 2011 - 01:26 PM, said:

Have you thinked about using github over google code?


Yes.
giix should be moved there when Yii is, too (planned to version 2).
0

#126 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 06 October 2011 - 06:52 AM

Thank you!

Guys, you are awesome.
A few days ago I saw that giix is currently ranking first as the most upvoted extension for Yii!

I'd like to thank you very much for your feedback :)

giix 1.9.1

And there is giix 1.9.1 (download here), with a fix for the issue #23. This issue was already fixed in the trunk, but I have decided to make this release until the new version is not ready.

Next...

And the version 2.0 is being carefully prepared. Stay tuned!
0

#127 User is offline   dragonka 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 15-October 11

Posted 15 October 2011 - 12:15 PM

Hello

At the beginning: sorry for my English.
I am a novice when it comes to yii, gii and giix. I'v read almost everything but I still do not know how to do a very simple thing.
There are two tables: Mother and Childrens, of course HAS_MANY relationship. At the beginning of file _form.php are mothers details and then a table with data of children (name, age). I do not know how to define inputs in the table. I think it can be done giix-frendly, but I do not know how. Please help!
0

#128 User is offline   smck 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 12-September 11

Posted 19 October 2011 - 04:52 AM

View Postdragonka, on 15 October 2011 - 12:15 PM, said:

Hello

At the beginning: sorry for my English.
I am a novice when it comes to yii, gii and giix. I'v read almost everything but I still do not know how to do a very simple thing.
There are two tables: Mother and Childrens, of course HAS_MANY relationship. At the beginning of file _form.php are mothers details and then a table with data of children (name, age). I do not know how to define inputs in the table. I think it can be done giix-frendly, but I do not know how. Please help!

Hi, Giix CRUD will generate form for mother table, where you will be able to select existing child items with checkboxes. You need to generate models for both tables first. Then you can generate CRUD for mother model. To be able to set properties of children in mother form you need to write custom code.

Read this page to find out how to deal with multiple child models in mother form:
http://www.yiiframew...1/en/form.table
1

#129 User is offline   nineinchnick 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 622
  • Joined: 12-September 11
  • Location:Bialystok, Poland

Posted 20 October 2011 - 01:36 PM

I just downloaded giix-1.9.1.tgz and it seems it's gzipped twice, or rather the tar.gz i gzipped again.
Don't be a dick.
0

#130 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 20 October 2011 - 01:55 PM

View Postnineinchnick, on 20 October 2011 - 01:36 PM, said:

I just downloaded giix-1.9.1.tgz and it seems it's gzipped twice, or rather the tar.gz i gzipped again.


Hi,

Thanks for reporting!
Another user also had problems with the archive. I had no issues here, but I'll generate a new file and upload it.
0

#131 User is offline   leogsouza 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 22-May 09
  • Location:São Paulo, Brazil

Posted 25 October 2011 - 09:19 AM

Hi,

I have a problem. I want define separated attribute labels for differents scenarios. When my AR extends of GxActiveRecord the property scenario is empty but when extends of CActiveRecord is correct.

Please help me!
0

#132 User is offline   Kyle Wallace 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-November 11

Posted 06 November 2011 - 10:31 PM

Hi All,

I'm new here, just started with YII and GIIX about a week ago.

I'm in not a PHP developer, I can only copy/paste and test the results, I only started learning about databases about one month ago.I have started using this as a tool to prototype a database I am working on. So please excuse me if the question I ask makes me look stupid.

Also please excuse me if this post is in an inappropriate place.

I am working with PHPMyAdmin as I can't do it without a GUI :rolleyes:

I have two tables and an extra table for many_many:

Table A:
id (PRIMARY)
name

Table B:
id (PRIMARY)
name

Table AB:
a_id (INDEX)
b_id (INDEX)
(I have tried a_id as PRIMARY, a separate id field as PRIMARY and both a_id and b_id as PRIMARY)

When I run GIIX Model and Crud generators I am not sure if it works properly with the relationship or if it was designed this way:

  • You cannot add relationships from an A or B entry, you instead have to do it from the AB CRUD page.
  • When looking at an A page, you can see a list of IDs for related Bs but it would be easier to see related B(names) which link directly to the other B (and not the AB view). :blink: does that make sense?


I know I am asking a lot (and perhaps not even making sense). I don't expect an answer to each element of this post but perhaps someone could point me in the direction of a tutorial which steps you through the entire process? That way I know I am using GIIX for many_many as it was intended.

Ta,

Kyle. :D
0

#133 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 07 November 2011 - 12:08 AM

View PostKyle Wallace, on 06 November 2011 - 10:31 PM, said:

You cannot add relationships from an A or B entry, you instead have to do it from the AB CRUD page.


Hi Kyle.
Welcome to the forum!

Before experimenting with PHP, I suggest you learn a bit more about databases.
Are you using MySQL/InnoDB? If so, I suggest you to take a look at FK Constraints.

Also, this question in Stack Overflow can get you started in a more friendly way.

View PostKyle Wallace, on 06 November 2011 - 10:31 PM, said:

When looking at an A page, you can see a list of IDs for related Bs but it would be easier to see related B(names) which link directly to the other B (and not the AB view). does that make sense?


Absolutely.
giix does that by default, but you need to setup you table relationship first. The links above will help you with that.
0

#134 User is offline   Kyle Wallace 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-November 11

Posted 07 November 2011 - 07:08 PM

View Postmentel, on 07 November 2011 - 12:08 AM, said:

Hi Kyle.
Welcome to the forum!

Before experimenting with PHP, I suggest you learn a bit more about databases.
Are you using MySQL/InnoDB? If so, I suggest you to take a look at link removed FK Constraints.

Also, link removed this question in Stack Overflow can get you started in a more friendly way.



Absolutely.
giix does that by default, but you need to setup you table relationship first. The links above will help you with that.


Hi Mentel,

Thanks for getting back to me re my post.

I had a look at the link and it looks like I am creating the relationships as expected. I should have mentioned I have done web DESIGN(no coding besides html/css) for many years but have always used a developer for the php/databases. So I have tinkered a bit before but mostly trial and error with extensive research.

The one_many relationships GIIX is establishing are fine. I think maybe I just expected too much from many_many (in terms of ease of use) by using the initial GIIX output. Maybe need to look into fine tuning a little...

Anyway, thanks a bunch. I'll probably be around here for a lot longer trying to learn YII. :rolleyes:

Ta,

Kyle.
0

#135 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 08 November 2011 - 03:22 AM

Hi Kyle,

I'm sorry for not being able to help you this time.
I believe the behavior you are expecting from giix is the standard behavior.
Please open a ticket and attach all the details you have and I'll help you.
0

#136 User is offline   A.Miguel 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 12-October 11

Posted 08 November 2011 - 07:25 AM

Hi mentel,


Congratulations; this looks to be an amazing extension. I am a newbie on Yii so that I am still struggling on it.


I have a few questions to ask you about giix. Let’s assume we have the following scenario:
tbl_order
 - id
 - order_desc

tbl_products
 - id 
 - product_desc

tbl_order_products
 - id
 - id order_id
 - product_id
 - quantity


One Order has many Products and one Product can belong to multiple Orders.


Questions
---------------------------------------------------------------------------------------------------
1: When should I use GiixModel Generator instead of normal Model Generator?

2: Is the order from which the models are generated relevant?

3: Is it supposed for Giix to generate proper MANY_MANY relation and set the correct pivot table on pivotModels method?
// Order model
'products' => array(self::MANY_MANY,Products , ‘tbl_order_products(order_id, product_id)'),


I did some tests here and ended on changing the relations manually.

4: For the scenario presented above the Giix extension would apply as well? If you noticed there is an extra field in tbl_order_products where user can set the product quantity for a specific order. Will the saveWithRelated work fine with multiple fields?


A tutorial would be a very good complement to this great extension. I believe there are several other features that we would appreciate on this extension.


Thanks a lot,
A.Miguel
0

#137 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 08 November 2011 - 11:56 AM

Hi,
Thanks for your kind words.

View PostA.Miguel, on 08 November 2011 - 07:25 AM, said:

1: When should I use GiixModel Generator instead of normal Model Generator?
2: Is the order from which the models are generated relevant?
3: Is it supposed for Giix to generate proper MANY_MANY relation and set the correct pivot table on pivotModels
4: For the scenario presented above the Giix extension would apply as well? If you noticed there is an extra field in tbl_order_products where user can set the product quantity for a specific order. Will the saveWithRelated work fine with multiple fields?


1: You can use it anytime you want. I always use it.

2: No. And you can generate all models at once using an asterisk "*" in the table name field.

3: Yes. You are having problems because of an extra and unnecessary "id" field in the pivot table. Make the FK's the composite primary key.

4: I didn't test this scenario, when you have to use "through". Please report if you find any issues.

I've been thinking about a tutorial, but currently time doesn't allow me to write one.
You can always request new features here.
0

#138 User is offline   Kyle Wallace 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-November 11

Posted 08 November 2011 - 05:05 PM

Mentel,

View PostKyle Wallace, on 06 November 2011 - 10:31 PM, said:


(I have tried a_id as PRIMARY, a separate id field as PRIMARY and both a_id and b_id as PRIMARY)


WRONG! I did try with composite primary FKs but when I went to use CRUD Gen. I thought cause there was an error it was incorrect and went no further.

Then I read this just now:

View Postmentel, on 08 November 2011 - 11:56 AM, said:

3: Yes. You are having problems because of an extra and unnecessary "id" field in the pivot table. Make the FK's the composite primary key.


So anyway took your advice and that's all the issue was. Being inexperienced I assumed you needed to generate crud for each model.

I guess it took someone else to articulate my issue correctly. :blink:

I feel a little silly... lol. Consider my issues resolved... FOR NOW.

EDIT: ANOTHER QUESTION (Sorry)

Hopefully it is appropriate to ask this here. Could somebody please tell me the appropriate way to show similar relations between the same tables? Example:

TABLE A
id
name
description

TABLE B
id
name
description

REL A_B (first one)
a_id
b_id

REL A_B (second one)
a_id
b_id


As you can see the two relation tables are identical however I need them to serve different purposes. Is it appropriate to have it set up like that or should I instead have one relationship table with:

a_id
b_id
type (and choose if its the first or second type here)


I have tried both ways however at this stage it will only show the info from one table (I think the second one it works with) and not display the other.

Thanks.. again.. :) Kyle.
0

#139 User is offline   Sebastian K. 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 62
  • Joined: 29-May 11

Posted 09 November 2011 - 04:22 PM

Hi guys,

I recommend to use MySqlWorkbench to design your database. In combination with giix you have a winning team.
In Workbench you just use the m:n identifiying relationship to connect two tables. Workbench create automatically the correct pivot table.
Giix then creates correct many-many relations where the pivot table is transparent.
Working with both tools has boosted my development iterations a lot.

BR
Sebastian
0

#140 User is offline   Rodrigo Coelho 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 664
  • Joined: 05-August 10
  • Location:Rio de Janeiro, Brazil

Posted 09 November 2011 - 04:25 PM

View PostSebastian K., on 09 November 2011 - 04:22 PM, said:

I recommend to use MySqlWorkbench to design your database.


Me too.
0

Share this topic:


  • (14 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • 8
  • 9
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

5 User(s) are reading this topic
0 members, 5 guests, 0 anonymous users