Jump to content
Larry Ullman's Book Forums

Yii Menus


Jonathon
 Share

Recommended Posts

Hi Larry,

 

In the periods between your book i thought i'd take your CMS idea and maybe build on it. One thing that I thought would be nice and is something that you've probably come across in your own web development is the ability for a user to generate their own menus / drop-down menus like you find in almost every website nowadays. (I must say WordPress's menu management is brilliant, i really like how easy it is)

 

From your own experience in relation to Yii, what is the best way to do this. Is it a DB table still as you'd need to control main navigation and sub menus?

 

An a second unrelated idea:

 

I have virtual hosts set up so all my projects are stored inside htdocs on XAMPP. I have my Yii framework now in the folder above which is the xampp folder. I moved the protected folder to this directory too. If I were to make a new webapp and wanted to move the protected folder of this webapp into the directory above htdocs (xampp folder). Is it just a case of renaming the protected folder "new_project_projected" and updating the index.php file to reference this newly named folder. Or does the folder need to be called protected? I know this sounds silly, but I thought i'd check.

 

Thanks again

 

Jonathon

  • Upvote 1
Link to comment
Share on other sites

Sorry to interrupt, but good to see you back on here Jonathon. I have almost come to the end of my reading on the PHP Advanced book, i have learned a lot, glad i listen to you and took two steps back to read Larry's books. Done JS book also.

 

How did your last Yii project go, did work on it up till now or did you wait until Larry's Yii book came out before proceeding further with it.

 

I did some practice building my own OOP MVC and it worked but there is no way i will be building everything alone I don't have the time, so i will be going with Yii for sure. Looking forward to reading your Yii post.

J

This is a good post very informative. These posts are very good for getting started with Yii. A good group of people have helped put these together. That's why Yii is a good framework to learn. It has a strong structure a good base better than other frameworks available. Right now Yii is the number 1 PHP framework because it is the easiest to use. Because it was built by a Chinese guy. It is the best PHP framework so far because of its ease of use and flibility.

Link to comment
Share on other sites

Hi Edward,

 

Glad you did that and have learned a lot. I am the opposite way around now, trying to remember things I once knew! I saw your Prometheus example and enjoyed it and thought that you'd obviously worked hard on your OOP. So it's good to see you've have had success. I have the old PHP Advanced book which I read a couple of years ago now, we talked about David Powers book, it was good in some ways, i didn't find the book as engaging as Larry's so perhaps I should buy the new edition of the PHP Advanced book for the writing and style and overall content.

 

I stopped that project about the time I stopped being so regular here, it's quite a big project and as i'm sure you know Yii does take time to learn. I got a decent way on my own, but it came to the point where I was just wandering aimlessly around Yii, not really knowing what something was there for, how exactly it all fitted together and rather than spend probably weeks hashing it together only to discover i'd made a fairly big omission or error early on that was going to cost me, i thought i'd wait for the Yii book. The database schema was going to be my biggest concern, making sure that was right as Yii generates all the models etc for you. Then there is the security of a framework you don't properly understand etc.

 

I suppose in many ways it's having the confidence to do something in a framework and how to fix it when it goes wrong, that's the easy part of writing your own code.

 

But yes I'm enjoying the book, I hope it sells well too!

  • Upvote 1
Link to comment
Share on other sites

I understand where you are coming from but the way I got around some of this problem is building my own MVC, try following along with some of these tutorials http://jream.com/lea...videos/php-oop. I done them but rewrote some of the code as i was following them as there was some bugs, but it gives more of an idea of how Yii and others MVC frameworks like Codeignitor work.

 

Now the way i see these objects is loading up in a hierarchy but all loading one before on another on a straight line if you like to look at it that way, i guess I could rename this the procedural line. But i do see where you are coming from kind of like "What objects load up first?" or "What do these objects do".

 

Most of those classes in a way do speak for themselves but there are the odd load i am also unsure of how to implement. I am actually planning on building my own classes for my practice site which is procedural now just to get some more class practice example.

 

I didn't read the old PHP Advanced book as i waited for the new one its changed a lot since last edition, Larry tailored the book as he knew people would continue onto a framework after. So effort was put in to emphasize on these framework techniques. There is a design patterns chapters, its really well explained makes these really easy unlike some books. There was also an explanation of Unified Modeling Language (UML) which was useful to comprehend those Class diagrams. If you have the time it would be worth getting most of the main OOP stuff and examples could be covered over a month i guess.

 

I do have confidence with Yii though as making the OOP MVC myself earlier made me realize that I would just be building a pile of similar untested code. Its smarter to use the framework. And security wise you can see that level of security yourself. All the Classes are already there just to call to run there static methods for striping tags, encoding, encrypting etc. As far as i see most of the security taught in books is all the same, i think the server, host, PHP etc may be the problem not the actual code.

 

By the way i didn't do any Yii, i just worked on my practice site a bit and done the JS book. I haven't worked on my practice site for about a month or more now. I intend to get the new OOP stuff in for practice like i said.

Link to comment
Share on other sites

Edward, why do you mean by the fact that PHP, the server and the host are the security problem, not the code itself?

 

What i was referring to here was PHP on the higher level, for instance PHP is always upgraded for improvements, as well as bug fixes, and possible other things. But the point being that there are most probably bugs that are effecting the level of security of our websites. So i was meaning we could be writing our code correctly following all the correct security procedures but something on the higher level is our security hole. You get what I am saying? This kind of gap is something that can only be fixed by its makers.

Link to comment
Share on other sites

True. The base languages do have problems, but then again, so do browsers. I suppose the one thing we can find solace in is the fact that the people that find these bugs and exploit them probably could care less about the sites we make, and would never target them.

  • Upvote 1
Link to comment
Share on other sites

Hi Larry,

 

In the periods between your book i thought i'd take your CMS idea and maybe build on it. One thing that I thought would be nice and is something that you've probably come across in your own web development is the ability for a user to generate their own menus / drop-down menus like you find in almost every website nowadays. (I must say WordPress's menu management is brilliant, i really like how easy it is)

 

From your own experience in relation to Yii, what is the best way to do this. Is it a DB table still as you'd need to control main navigation and sub menus?

 

An a second unrelated idea:

 

I have virtual hosts set up so all my projects are stored inside htdocs on XAMPP. I have my Yii framework now in the folder above which is the xampp folder. I moved the protected folder to this directory too. If I were to make a new webapp and wanted to move the protected folder of this webapp into the directory above htdocs (xampp folder). Is it just a case of renaming the protected folder "new_project_projected" and updating the index.php file to reference this newly named folder. Or does the folder need to be called protected? I know this sounds silly, but I thought i'd check.

 

Thanks again

 

Jonathon

 

I have a similar setup as you as i am using XAMPP, i have just left my protected folder for now in the root directory because if i put my framework below the root direct e.g in C:\xampp\ i would have to change my project setup in my Dreamweaver IDE and i would have to do more clicking around than usual to get into certain locations, i think unnecessary for a localhost. It would seem to me though that the protected folder should not be renamed in the case that it could be used by something in the site we are unaware of and could through errors later on. I will move the protected folder and update my bootstrap on the live server.

 

I found something here on the YiiFramework forum, apparently so the protected folder could be renamed.

 

http://www.yiiframework.com/forum/index.php/topic/33846-public-folder/

Link to comment
Share on other sites

 Share

×
×
  • Create New...