Yii Framework Forum: Loading a view from a model - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Loading a view from a model Rate Topic: ***** 1 Votes

#1 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 01 October 2009 - 07:00 PM

I'm using the users model with an afterSave method placed after register to send the confirmation email but how can I load a view from the model to make it as a message body. I don't want to create a module because I need to centralize my themes so the users can find and edit them easily. Any ideas?
0

#2 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 01 October 2009 - 07:32 PM

View Postmanilodisan, on 01 October 2009 - 07:00 PM, said:

I'm using the users model with an afterSave method placed after register to send the confirmation email but how can I load a view from the model to make it as a message body. I don't want to create a module because I need to centralize my themes so the users can find and edit them easily. Any ideas?


i'm not sure what you are trying to do but first and foremost i don't think views are supposed to be loaded by models. could make it clearer what you want to do?
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#3 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 02 October 2009 - 10:07 AM

Found a workaround, thanks.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users