Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'controller'.

  • 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. Hello, I am working on admin panel and i have one list page where alll records are displayed i want to send record ID with href to controller like <a href="<?php echo Yii::app()->request->baseUrl.'backend/vehicle/edit/'.$row['vehicle_id'] ?>">Edit</a> but its not working its giving error page not found. when i pass value with "?" query string it works but i want to pass as i mention above please help.
  2. Hi, I got all the way through the tutorial with no problems until the very end. In “EmployeeController.php” I’m trying to get yii to display the relation for department rather than the ID number. I have tried this code in the loadModel method: $model=Employee::model()->with('department')->findByPk((int)$id); I have double checked all of my relations and they all seem to be in order. It’s still showing the ID number rather than the department name. Any ideas? Thanks
  3. version 0.5 Page 113 Quoting from the book: "The view files generated by Gii have comments at the top of them that indicate the variables that were passed to the view file. For protected/views/site/index.php, that’s: <?php /* @var $this SiteController */ For protected/views/user/create.php, you’ll see: <?php /* @var $this UserController */ /* @var $model User */ " My question: What actual variables are passed? Is SiteController a variable? Is UserController a variable? What exactly does "$model User" mean? Thanks.
  4. Version 0.5 Two questions about page 115. 1. Quoting from the book: "<?php $this->pageTitle = Yii::app()->name . '::' . $model->title; ?>" Why are there two colons before $model->title ? I assume they will appear literally, but maybe they function as code -- I'm not sure. 2. Quoting from the book again: "{TIP} Because the page title is set by assigning a value to the controller instance, it can also be set within the controller action, if you’d rather." This sentence is saying 2 things, neither of which I understand. Larry, can you please break this down and provide an example? Thanks.
  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...