def edit(self, id):
        article = Article().find(id)

        if article.user().id == Auth.user().id:
            return view('articles.edit', article=article)

        return ErrorResponse('Unauthorised', 500)
 def index(self):
     articles = Article().paginate(size=5)
     return view('articles.index',
                 articles=articles[0],
                 pagination=articles[1])
 def create(self):
     return view('articles.create')
 def show(self, id):
     return view('articles.show',
                 article=Article().find(id),
                 user=Auth.user())
예제 #5
0
 def login(self):
     return view('users.login')
예제 #6
0
    def show(self, id):

        return view('users.show', user=User().find(id))
예제 #7
0
 def register(self):
     return view('users.register')
예제 #8
0
 def index(self):
     return view('pages.index')