Jump to content
Larry Ullman's Book Forums

Jonathon

Members
  • Posts

    1064
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Jonathon

  1. Hi Just wondered about this. Obviously you can view an inidividual record in Yii using the actionView() method. So for an example www.example.com/item/1 Would return that record. For SEO purposes it would be nice to load in the url www.example.com/item/1/items-name A couple of things for this. 1) Should I store a slug hyphenating the individual items name? Secondly is it just a case of using something like this in your routes '<controller:\w+>/<id:\d+>/<title:\^[a-zA-Z-]+>'=>'<controller>/view', I'm not sure if that is a Regex problem or not. I did check it out in a regex tester and it seems to work, but I get "The system is unable to find the requested action "1". when i try to load the page with a title. On the other hand '<controller:\w+>/<id:\d+>/<title:\w+>'=>'<controller>/view', allows me to find www.example.com/item/1/itemsname Which is half way there. I'm just not 100% sure what my problem is currently. I should also mention that the title "items-name" isn't important to me within a query. I'd be happy to just use the id to find a record. The title was purely for SEO/aesthetics. Thanks Jonathon
  2. Hi Edward, I started it ages ago then decided to leave it until Larry's book so i'm kind of building the CMS with Larry and also doing some work on the Yii project as the chapters come out.
  3. There are actually 1000s of lines of CSS in the un-minified version. It's only really to play with Yii however, but I quite liked it. I'm not much of a designer. I can code CSS fine, it's just I severely miss the art side of it and making it look nice. Thanks anyway, you must drop me a email and let me know how your project was going.
  4. As always thanks Jonathan. Yes I suspected number 2, but wanted some input from a .js Aficionado. I'm going tobuild a site in Yii. Plan to do the whole thing with no Ajax so that it works. But started looking at Bootstrap and thought i'll have a play. Then got well into it, but i'm trying to keep in fairly .js minimal. Thanks Jonathon
  5. Hi, I've been using Twitter's bootstrap as a base for my site. I've been just playing with it in most browsers to see how it works. But one thing struck me, when JS isn't enabled I'm not sure how to overcome these problems. Forgive me if this is in Larry's book, I haven't finished reading it although I did have a quick look. I notice that in your site Larry if you disable JS and then resize your screen you get the bootstrap collapsed menu, however you can't click it to reveal your navigation links. I too would have the same problem plus I have a login within my navbar. I'm just wondering how or what exactly you go about fixing this problem? Again, apologies if this is covered in the book, I couldn't see it. Thanks Jonathon
  6. Debug the category $_POST variable. Does it exist, what values is it passing through, then take it from there.
  7. The problem is still the same though. Your script is trying to find a function that it can't access or doesn't exist.
  8. Thanks Larry, very kind of you
  9. That's no problem Larry. It would be nice obviously if at least 1 format allowed me to just update the book. However if it can't be fixed or takes some time isolating the problem it takes some time. It was just to let you and others know my experience incase it was an error on my part. Thanks and Happy New Year Jonathon
  10. Hi Armlocker, Have you done much PHP previously? I only say this because this book is pretty complex at times and if you don't know why this error is happening then it's probably too advanced for you at this moment. Anyway, the error is due to an undeclared function, that doesn't happen on line 72. It's just where you tried to call create_password_hash(). So is the function actually declared in that file or accessible to the current page?
  11. I've got the book yes. But it's been a long time since I read it though. From memory he does something like this: define ('BASE_URI', '/path/to/dir/'); define ('BASE_URL', 'www.example.com/'); define ('MYSQL', BASE_URI . 'mysql.inc.php'); If this is your first book for PHP it might be difficult at times. His latest 4th edition PHP and MYSQL is a very good book and will give you a great grounding in most web development areas. Good luck
  12. It's not a connection error. It's that the file reference isn't correct. So the location you put as the require file doesn't exist - that's all. It might actually just be this require ('includes/mysql.inc.php');
  13. Hi Larry, I've been using the Kindle version (MOBI) that's where all my notes are. I tried the epub version for iBooks and had the same problem though. It's not a huge issue for me, I can always write my notes up again once the whole thing is finished. I was mainly hoping it was an issue with me and my lack of Apple OS. Thanks again Jonathon
  14. No, it is required. But Larry is saying ideally you should store it outside your web directory root if at all possible. For instance I have directories above my web root, so I can store my framework folder in there and not in the web root.
  15. Hi Larry, I download the mobi version. My notes are on the kindle app, from memory there was a problem ibooks itself when the book was first released so i just stuck with Kindle.
  16. Hi Larry and others, Thanks for the new update. I ahve a question/problem. I wanted to put it here for other people to see as it could just be me. I have an iPad3 and have downloaded the Yii Book, every time a new release comes out it says open in ibook or kindle and i do and it just downloads another copy of the book. So currently, I have the first part in a book in kindle, a second book with the extra chapter and now a third copy of the Yii book. Am i doing something wrong here (clearly). I've never had anything Apple before so it could be me. Any help would be great Thanks Jonathon
  17. Thanks Edward Yeah that's what I thought, does Yii just map your DB columns to attributes. Yes i've just looked at CActiveRecord -thanks
  18. Hello With this code in the book, I placed it in my user model rather than use a scenario. Is that all there is to it when you create a new user. Now it would either create the date_created column or update the date_modified column? I was thrown a little bit by the $this->created and $this->modified statements in the book as they don't directly match the column names' being used in the book. Tried to look into the beforeSave() more but couldn't find anything. /** * Checks whether a record is new or not and updates date_created or _date_updated columns */ public function beforeSave(){ // If new DB record if ($this->isNewRecord) { $this->created = new CDbExpression('TIMESTAMP()'); } else { // If updated record $this->modified = new CDExpression('TIMESTAMP()'); } return parent::beforeSave(); } Thanks Jonathon
  19. The book is being published as it is written, currently only chapter 5 is completed
  20. Hi Larry, At the time I did check my code against yours, and couldn't see any errors. Then I just copied yours across and it worked fine and noted i'd put single quotes around some of the rules when I should have just separated them with a comma. I've since shaved and shut down my PC so I couldn't tell you my original code (sorry). Just tried to recreate it, couldn't achieve this though. Jonathon
  21. It was just the model rules for user() that Larry had in the book. I'd quoted each required field, when i shouldn't have. // Required fields array('username, email, pass', 'required'),
  22. Hi Larry, I'vw just been working through the rules you create and just having a play with Yii. Whilst I was looking at file/create I had a look at user/create too. Page through this error. exception 'CException' with message 'Property "CEmailValidator.0" is not defined.' in C:\xampp\yii-1-1-12\framework\base\CComponent.php:174 I could send the whole stack trace but didn't want to, I wasn't sure if this was expected behaviour at this point as we're working through or if it was a sign of an error in my work. Jonathon
  23. Thanks Larry, no rush. I can manage with it, but in the long run it won't be that convenient. thanks for getting back to me Jonathon
×
×
  • Create New...