Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'method'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 5 results

  1. Hi Larry, I have been working through the book and am at script 7.6 - rectangles5.cpp. Because of the constructor, I found that the setSize method is no longer needed as the constructor does the same job. I commented out all references to the setSize method and the application executes correctly in my Dev-C++ IDE. FYI, Cheers from Oz.
  2. I'm not sure how the second part of this example is related to the first, and where it belongs. I am quoting from page 174 of YiiBook2: # models/Page.php public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); } This means you can fetch every page with every page author in one step: $pages = Page::find()->with('user')->all(); I'm guessing that with('user') calls the getUser method. Is that right? But in which file does the second part of the example belong? In the view file?
  3. First, thanks to both of you for writing the book and for how well the content is explained. However I'm having trouble understanding this statement on page 260: From what I can find via Google searches and tinkering with the pets4.cpp code, having a method in the derived class with the same name (different signature or not) as one in the base class hides the base class method, much like overriding a method seems to. Can you maybe explain that in a different way so it makes more sense to me? Thanks in advance!
  4. Hello, Is there a rule I should think of when deciding to use a property vs a method? Thanks, K
  5. Version 0.5 Loading a Single Model The following two examples work together. The second calls the first. I believe the purpose is to retrieve a record from a table. And I believe each occurrence of $id represents the primary key value of the particular record we want. My question is, how do these functions know which table to search in? page 136: public function loadModel($id) { $model = Page::model()->findByPk($id); if ($model===null) { throw new CHttpException(404, 'The requested page does not exist.'); } Page 139: public function actionView($id){ $this->render('view',array( 'model'=>$this->loadModel($id), )); }
×
×
  • Create New...