Jump to content
Larry Ullman's Book Forums

msruby64

Members
  • Posts

    3
  • Joined

  • Last visited

msruby64's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I second that. Please complete the 2nd edition.
  2. I've been able to create static pages through the SiteController using the ViewAction class. One thing I have not been able to figure out is whether it's possible to have static views using the Yii convention for views of lowerCamelcase but have the url have hyphens in it. For example, if I name the static view file designProcess.php, then www.domain.com/designProcess will display the view file properly. However, if I want to use www.domain.com/design-process, then I have not been able to figure out a way to route that to display the designProcess.php file. I can rename the view file design-process.php, but that goes against the Yii naming convention. I realize I could create a function actionDesignProcess() in the SiteController and with the proper rule in the urlManager, route design-process to actionDesignProcess(), but I'd prefer to use the ViewAction class for static pages. Any help would be appreciated. Thanks, Mitchell
  3. Just bought the Yii book and am working my way through it. On page 79, it refers to the Yii User model and says: "for now, rename models/User.php as models/Useroriginal.php so you can revisit that code later." After doing that and using the Gii model and controller generators, I get the error below when I go to any page. I think that perhaps renaming the User.php file has a side effect. If I change the name from Useroriginal.php back to User.php, the error goes away. PHP Warning – yii\base\ErrorException include(M:\RCD\Clients - Active\yii2_basic_test\vendor\yiisoft\yii2/web/User.php): failed to open stream: No such file or directory 1. in M:\RCD\Clients - Active\yii2_basic_test\vendor\yiisoft\yii2\BaseYii.php at line 288 Line 279: } elseif (strpos($className, '\\') !== false) { $classFile = static::getAlias('@' . str_replace('\\', '/', $className) . '.php', false); if ($classFile === false || !is_file($classFile)) { return; } } else { return; } Line 288: include($classFile); if (YII_DEBUG && !class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) { throw new UnknownClassException("Unable to find '$className' in file: $classFile. Namespace missing?");
×
×
  • Create New...