Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorichbinweg

    Hi Forum, I am pretty new to akelos... Here my Question(s):

    What would be the correct way of implementing for example a website navigation in akelos? If we stay at the booklink tutorial ... there are no crosslinks from author to book and back.

    I am wondering what would be the correct way? After consulting http://wiki.akelos.org/internal-navigation I found out, that one was could be implementing for example in author_cotroller a new Method wich redirects to the Book-Listing.

    This could look like:

    function gotoBook()
            $this->redirectTo(array('controller' => 'book','action' => 'listing'));

    In every View of author were a linking to Books is necessary, the following code creates a link to the Book-Listing. In this example i added in ..\views\author\show.tpl the first line of the Listing...

        <li><?php  echo  $url_helper->link_to($text_helper->translate('GoTo Book'), array('action' => 'gotoBook'))?></li>
        <li><?php  echo  $url_helper->link_to($text_helper->translate('Edit this Author'), array('action' => 'edit', 'id'=>$author->getId()))?></li>
        <li><?php  echo  $url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li>

    But my Questions is this the correct way - or does the menu_helper provide some more specials for that kind of work?

    thx for helping out, Sebastian

    • CommentAuthorKaste

    a method in author_controller wouldn't be available 'globally'. I think a better place would be in the/an application-helper.

    Second, ->redirectTo doesn't give you an url, it really redirects you.

    In fact we have named-routes somewhere in the svn-pipeline, until we merge you could

    //in a helper
    function link_to_books_listing()
        return $this->_controller->url_helper->link_to(
                        $this->_controller->t('Goto Books'), 
                        array('controller'=>'book','action' => 'listing'));

    and call that function from your view.

    • CommentAuthorichbinweg

    Hello Kaste and Forum,

    thx for your answer - I'll go that way. I am not sure, if my next question fits to the started discussion here or if it should get it's own thread ...

    I checked out other possiblities and i found in the Admin-Plugin as another way of Internal Navigation - with the possibility to Role Based Access - id needed ...

    Assuming that i installed the admin-Plugin successfully into akelos, and i created a new project booklink with the admin feature, my question in this way is:

    how would i have to include the booklink objects book and author correctly?

    My first Thoughts according to the Steps explained in the admin-Tutorial was to use the admin_scaffold Generator:

    //in the console in /booklink
    ./script/generate admin_scaffold author
    ./script/generate admin_scaffold book

    as i read in the admin-Plugin Tutorial, controllers and helpers are generated in the admin plugin so i guess it is the correct way. Assuming that a hole project uses the admin functionalities, it would mean that all the project structure ist generated in this Plugin - or should other sources be generated outside of the Plugin with the same functionality - to keep the structure clean?

    thx for helping out, Sebastian

    • CommentAuthorKaste

    Sorry, I don't use the admin-plugin. Generally speaking, an admin plugin should administer users, groups, stuff which is not public. If your public website is so to speak read-only, it contains only views, you could do all the stuff inside the admin section and have a page_controller outside (say a CMS). (the opposite is a 'social' network, where you often have to decide just if a user is looking at his own profile or at someone elses.)

    but 'structural things' and tips you actually cant give abstract.

    • CommentAuthorichbinweg

    I was thinking - still staying in the booklink tutorial - that unregistered users could see and use the Links, controllers and views: view and listing. Only registered Users are allowed to add authors and books - I think that is very often a tipical situation...

    The admin-plugin allows you to generate controllers which integrates the menu and link structure with a role based access control(RBAC). It seems to be awsome, plus it provides that RBAC System from the scratch and you can use it from instance...

    But still thanks for your answer - I will figure that out and write a Tutorial, or post a solution here.. Greetings from Bremen, Germany, Sebastian