colap
Members-
Posts
302 -
Joined
-
Last visited
Everything posted by colap
-
Yes, now it works. <?php class Model_MenuAcl extends Zend_Acl{ public $_acl=null; public function __construct(){ $onerole=new Zend_Acl_Role('user1'); $tworole=new Zend_Acl_Role('user2'); $this->addRole($onerole); $this->addRole($tworole); $res1=new Zend_Acl_Resource('add'); $res2=new Zend_Acl_Resource('edit'); $res3=new Zend_Acl_Resource('delete'); $this->addResource($res1); $this->addResource($res2); $this->addResource($res3); $this->allow($onerole,array($res1,$res2)); $this->deny($onerole,$res3); } } Would you please explain this line $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => '')); And if i want to put that MenuAcl.php file somewhere else then what would i have to configure/change?
-
I'm getting this error, <?php class Model_MenuAcl extends Zend_Acl{ public $_acl=null; public function __construct(){ $onerole=new Zend_Acl_Role('user1'); $tworole=new Zend_Acl_Role('user2'); $this->_acl->addRole($onerole); $this->_acl->addRole($tworole); $res1=new Zend_Acl_Resource('add'); $res2=new Zend_Acl_Resource('edit'); $res3=new Zend_Acl_Resource('delete'); $this->_acl->addResource($res1); $this->_acl->addResource($res2); $this->_acl->addResource($res3); $this->_acl->allow($onerole,array($res1,$res2)); $this->_acl->deny($onerole,$res3); } }
-
Error: <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected function _initAutoload(){ $resourceLoader = new Zend_Loader_Autoloader_Resource(); $resourceLoader->addResourceType('model', 'models/', 'Model_'); } }
-
Explain this line please. $resourceLoader->addResourceType('model', 'models/', 'Model_');
-
No. How can i do this?
-
Error: Fatal error: Class 'Model_MenuAcl' not found in C:\Program Files\Zend\Apache2\htdocs\website\application\layouts\scripts\layout.phtml on line 16 MenuAcl.php is in Models/ <?php class Model_MenuAcl extends Zend_Acl{ public function __construct(){ $this->add(new Zend_Acl_Resource('index')); $this->add(new Zend_Acl_Resource('add')); $this->add(new Zend_Acl_Resource('edit')); $this->add(new Zend_Acl_Resource('delete')); $this->addRole('user1','index'); $this->allow('user1',array('add','edit','delete')); } } layout.phtml <head> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/jwplayer.js'); ?> <?php echo $this->headScript()->appendFile($this->baseUrl() . '/js/swfobject.js'); ?> <?php echo $this->headLink()->prependStylesheet($this->baseUrl().'/css/topmenu.css'); ?> </head> <?php $flXml=new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $container = new Zend_Navigation($flXml); Zend_Registry::set('Zend_Navigation', $container); ?> <div id="nav-menu"> <?php $_acl=new Model_MenuAcl; $_auth=Zend_Auth::getInstance(); echo $this->navigation()->menu()->setAcl($_acl)->setRole($_auth->getStorage()->read()->role); echo $this->loggedInAs(); echo '<br><br>'; echo 'You are in: ' . $this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?></div> <div class="mainbody"><?php echo $this->layout()->content; ?></div> <br /> In navigation.xml file i have these: <add> <label>Add</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </add> <edit> <label>Edit</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </edit> <delete> <label>Delete</label> <controller>index</controller> <action>ac</action> <resource>add</resource> </delete>
-
This code: function videoPlayer($flv) { $html = "<script>\n"; // javascript script code here $html .= "</script>\n"; return $html; }
-
Can you please post that PHP code?
-
Is there any PHP function to play .flv flash video file? That PHP function will automatically generate html embed code. Any code?
-
I have some picture url in table cells. If i click any one of the picture it will redirect to a a new page with a flash video file or .flv file. This file will be played in that page. How can it be done with zend framework?
-
Can anyone post example code to post a form with cakephp and the result will be displayed in another page.
-
Aptana studio 3.0 no autocomplete for zend framework
colap replied to colap's topic in Editor Help (PhpStorm, VS Code, etc)
I remember , i added Zend library to the project but the autocompletion didn't work. -
That IDE must have: 1)Auto complete option 2)Highlight option
-
What is Pardon? It's about auth question. After successfull login there navigation menu extends with additional links.
-
Which is a better way for Zend_Acl and Zend_Resources? Suppose i have a navigation menu with login. After successfull login as admin there will be additional links. Is it better to make navigation menu using xml file to set Zend_Acl access and to make Zend resources? Or any other method?
-
Thank. Editing CSS did the trick.
-
Can anyone post code for Zend Framework horizontal menu? This doesn't look like a horizontal menu: <div> <?php $pages = array( array( 'label' => 'Home', 'controller' => 'index', 'action' => 'index', ), array( 'label' => 'A', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'P', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'Add', 'controller' => 'index', 'action' => 'b', ), array( 'label' => 'S', 'controller' => 'index', 'action' => 'index', ), array( 'label' => 'A', 'controller' => 'index', 'action' => 'a', ), array( 'label' => 'B', 'controller' => 'index', 'action' => 'b', ) ); $container = new Zend_Navigation($pages); Zend_Registry::set('Zend_Navigation', $container); ?> </div> <br/> <div> <?php echo $this->navigation()->menu(); echo 'You are in: '.$this->navigation()->breadcrumbs()->setLinkLast(false)->setMinDepth(0)->render(); ?> </div>
-
Image display in a div reading image filename from database
colap replied to colap's topic in PHP Coding Help
The link you gave is not readable. The images below the page is not readable. -
Hello, Five images will be displayed inside a division. There will be a previous and next button/link. If someone click the next button the next image will be added in that div and the first image will be gone from that div. The previous button/link will do the same thing. Is it possible with php? I am confused if it's a javascript or ajax question. Thanks.
-
Can you post the embed html code?
-
It may be html question. How can i play .flv or .swf file on my web site? Can someone post sample code? I'm following this but can't fix it. http://www.ffmpegx.com/flv.html
-
Which is better reloading the whole page or reloading division with ajax?
colap replied to colap's topic in PHP Coding Help
Above means the navigation link menu which is located above the web page.You can say horizontal menu. -
Hello, I have links at above of the page. if i click a link a new page will appear. The menu links above are same for all pages. Which is better reloading the whole page with all menu links or keeping the above menu link permanent/unchange reloading bottom division with ajax? I mean only one page will contain the menu.Is it better? Or every page will contain the menu above.Is it better then the first one? I say many web site they have link menus above if i click a link from above it seems the whole page reloads or chages. For example:http://www.sitepoint.com/ Thank you.