Hi,
I am very new to yii. I also do have a limited understanding of MVC approach.
I created a new application named "My Application". I have already been playing with the framework and decided to change the layout to a different one. I connected to a database and created some models and CRUD. All went fine. The main.php in views\layouts\ was very intelligent enough to explain novice users like me that yii uses blueprint css framework. So, it was very easy for me to change the layout accordingly.
I changed the template to put the menu on the left hand side and the rest on right side, and it worked absolutely fine. I wanted to replace inbuilt menu with treeview which would be
role based,
database driven,
environment aware (at the beginning en-US)
For that, I created new tables in database (PostgreSQL).
[sql]
CREATE SCHEMA "Policy";
CREATE TABLE "Policy"."Menus"
(
"MenuId" SERIAL NOT NULL PRIMARY KEY,
"MenuCode" varchar(12) NOT NULL,
"Url" varchar(50) NOT NULL,
"ParentMenuId" integer NULL REFERENCES "Policy"."Menus"("MenuId")
);
CREATE TABLE "Policy"."MenuLocalized"
(
"MenuItemId" SERIAL NOT NULL PRIMARY KEY,
"MenuId" integer NOT NULL REFERENCES "Policy"."Menus"("MenuId"),
"LanguageId" integer NOT NULL, --REFERENCES "Core"."Languages"("LanguageId"),
"MenuText" varchar(50) NOT NULL,
CONSTRAINT "Policy_MenuLocalized_uix" UNIQUE("MenuId","LanguageId")
);
CREATE VIEW "Policy"."MenuView"
AS
SELECT
"Menus"."MenuId",
"Menus"."MenuCode",
"Menus"."Url",
"MenuLocalized"."LanguageId",
"MenuLocalized"."MenuText"
FROM
"Policy"."Menus",
"Policy"."MenuLocalized"
WHERE
"Menus"."MenuId" = "MenuLocalized"."MenuId";
[/sql]
I changed the lines of main.php (in menu placeholder) to
<?php
$this->widget(
'CTreeView',
array('url' => array('ajaxFillTree'))
);
?>
Now, I do not know what to do next. I was unable to find the controller of main.php with many failed guesses. Please help.