If you only want to customize the templates for an existing generator, you should only add those template files as I described. Do not copy any other files (such as ModelCode.php, ModelGenerator.php). I just tested this without any problem.
If you want to change the code model and generator, then you need to either extend existing ones or write your own. This is less common.
What is the problem with using “/layouts/main”? If you use “gii.views.layouts.main”, you won’t be able to theme it.
As a feature request… in Cake there was a feature to ‘bake’ all models and crud… it would be nice if there was 1 button to click to create all models + crud in a databases as shortcut.
I think we got some misunderstanding here. I created a yii theme with the files from webapp skeleton, CSS, JS and views.
I want to have the ability to test all new features from yii within my app without a messed up layout.
So if I want to run gii now, it takes the view main.php from webapp skeleton (from the theme) and this one needs breadcrumbs and menu as a property, which gii’s DefaultController does not have.
And I am able to theme gii with the above solution, here is my directory layout:
They’re working really great now. In phundament beta 7 I’ve created a yii-theme, so I am able to run my app in the same style like the webapp skeleton.
If someone is interested, this is the complete directory layout of the yii-theme.
I think modules such as gii should not use absolute paths to layouts and views, otherwise you won’t be able to overwrite them in a theme, which may lead to problems, or said the apposite way: themes can do some really nice things for you.
What do you think? Is there a need for absolute paths or do I overlook other problems here, because using the short way also worked for me in the webapp skeleton.
By switching the the unprefixed tables names the Relation widget is able to detect a relation in a correct way.
Just another 2 cent.
[edit]
Another problem I stumbled upon are the private variables in ModelCommand.
I’ve extended ModelCommand into P2ModelCommand, and overwrote generateRelations() but with private vars I am not able to use it. Protected ones are no problem.
I’m using Apache2 on Ubuntu Lucid and it works when I run Apache as the default www-data user and group. However, when I change this to a regular user (with sudo rights) in /etc/apache/envvars, I can no longer login to Gii. The webserver runs fine though…
(in case you’re are wondering why I want to change the webserver user: it’s a development machine and I don’t want permission issues between the webserver and the development tools I’m using to write code. This way all the /var/www files and directories are owned by the user I’m logged in to the GUI so I can do direct editing, and the webserver can do its file/directory actions.)
I’m new to Yii. However, I have followed the books to start learning Yii.
While I tried to generate model(s) from GUI (Gii), I don’t know it’s a bug or not, but I put the table prefix (e.g. “tbl_”) in the model generation form, and type-in the suffix of table name (e.g. Project) (i.e. table name is “tbl_project”), but error occurred.
It prompted the table "Project" not exist.
However, if no prefix was put, and put the whole name of the table (i.e. "tbl_project"),